update pipeline

This commit is contained in:
Mitchell Marino 2023-03-18 20:47:40 -05:00
parent 21007a1269
commit 39570aae05

View File

@ -23,21 +23,126 @@ resources:
source: source:
port: 2375 port: 2375
host: mdev.local host: mdev.local
- name: rust
type: registry-image
source:
repository: rust
jobs: jobs:
- name: test - name: test
plan: plan:
- get: repo - get: repo
- get: rust
trigger: true trigger: true
- task: test - task: test
file: repo/ci/test.yml config:
platform: linux
image: rust
params:
CARGO_HOME: "./.cargo-config/"
RUSTUP_HOME: "./.rustup-config"
caches:
- path: "./repo/target"
- path: "./repo/.cargo-config"
- path: "./repo/.rustup-config"
inputs:
- name: repo
run:
path: sh
args:
- -exc
- |
rustup default stable
cargo test
dir: repo
- task: lint - task: lint
file: repo/ci/lint.yml config:
platform: linux
image_resource:
type: registry-image
source:
repository: rust
params:
CARGO_HOME: "./.cargo-config/"
RUSTUP_HOME: "./.rustup-config"
caches:
- path: "./repo/target"
- path: "./repo/.cargo-config"
- path: "./repo/.rustup-config"
inputs:
- name: repo
run:
path: sh
args:
- -exc
- |
rustup default stable
rustup component add clippy
cargo clippy
dir: repo
- task: audit - task: audit
file: repo/ci/audit.yml config:
platform: linux
image_resource:
type: registry-image
source:
repository: rust
params:
CARGO_HOME: "./.cargo-config/"
RUSTUP_HOME: "./.rustup-config"
caches:
- path: "./repo/target"
- path: "./repo/.cargo-config"
- path: "./repo/.rustup-config"
inputs:
- name: repo
run:
path: sh
args:
- -exc
- |
rustup default stable
cargo install cargo-audit
cargo audit
dir: repo
- try: - try:
task: check-fmt task: check-fmt
file: repo/ci/check-fmt.yml config:
platform: linux
image_resource:
type: registry-image
source:
repository: rust
params:
CARGO_HOME: "./.cargo-config/"
RUSTUP_HOME: "./.rustup-config"
caches:
- path: "./repo/target"
- path: "./repo/.cargo-config"
- path: "./repo/.rustup-config"
inputs:
- name: repo
run:
path: sh
args:
- -exc
- |
rustup default stable
rustup component add rustfmt
cargo fmt --check
dir: repo
- name: build - name: build
plan: plan:
@ -45,26 +150,69 @@ jobs:
trigger: true trigger: true
passed: [test] passed: [test]
- task: build-linux - task: build-linux
file: repo/ci/build-linux.yml config:
platform: linux
image_resource:
type: registry-image
source:
repository: rust
params:
CARGO_HOME: "./.cargo-config/"
RUSTUP_HOME: "./.rustup-config"
caches:
- path: "./repo/target"
- path: "./repo/.cargo-config"
- path: "./repo/.rustup-config"
inputs:
- name: repo
run:
path: sh
args:
- -exc
- |
rustup default stable
cargo build --release
dir: repo
- task: build-docker - task: build-docker
privileged: true privileged: true
file: repo/ci/build-docker.yml config:
platform: linux
image_resource:
type: registry-image
source:
repository: concourse/oci-build-task
inputs:
- name: repo
path: .
outputs:
- name: image
run:
path: build
- put: docker-image - put: docker-image
params: params:
image: image/image.tar image: image/image.tar
- name: deploy - name: deploy
serial: true
plan: plan:
- get: repo - get: repo
trigger: true trigger: true
passed: [test, build] passed: [test, build]
- put: deploy - put: deploy
params: params:
DOCKER_HOST: "tcp://mdev.local" command: down
command: restart path: repo
# compose_file: repo/docker-compose.yml - put: deploy
params:
command: up
path: repo path: repo
pull: true pull: true
# path: home/mitchell/prod/school_app_api
# path: code