2023-05-14 18:42:03 +00:00
|
|
|
stages:
|
|
|
|
- checks
|
2023-05-27 12:08:47 +00:00
|
|
|
- build
|
2023-05-14 18:42:03 +00:00
|
|
|
|
|
|
|
cargo-test:
|
2023-05-27 12:08:47 +00:00
|
|
|
image: rust:latest
|
|
|
|
stage: checks
|
|
|
|
script:
|
|
|
|
- cargo test --workspace
|
|
|
|
rules:
|
|
|
|
- exists:
|
|
|
|
- Cargo.toml
|
|
|
|
|
|
|
|
cargo-clippy:
|
2023-05-14 18:42:03 +00:00
|
|
|
image: rust:latest
|
|
|
|
stage: checks
|
|
|
|
before_script:
|
|
|
|
- rustup component add clippy
|
|
|
|
script:
|
|
|
|
- cargo clippy --workspace
|
2023-05-27 12:08:47 +00:00
|
|
|
rules:
|
|
|
|
- exists:
|
|
|
|
- Cargo.toml
|
|
|
|
|
|
|
|
cargo-fmt:
|
|
|
|
image: rust:latest
|
|
|
|
stage: checks
|
|
|
|
before_script:
|
|
|
|
- rustup install nightly
|
2023-05-27 12:18:58 +00:00
|
|
|
- rustup component add rustfmt
|
2023-05-27 12:08:47 +00:00
|
|
|
script:
|
|
|
|
- cargo +nightly fmt --check
|
|
|
|
rules:
|
|
|
|
- exists:
|
|
|
|
- Cargo.toml
|
|
|
|
|
|
|
|
development-image:
|
|
|
|
image: docker:latest
|
|
|
|
stage: build
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
script:
|
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
|
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
|
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
|
2023-05-27 12:19:20 +00:00
|
|
|
exists:
|
2023-05-27 12:08:47 +00:00
|
|
|
- Dockerfile
|
|
|
|
|
|
|
|
production-image:
|
|
|
|
image: docker:latest
|
|
|
|
stage: build
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
script:
|
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
|
- docker build -t $CI_REGISTRY_IMAGE:latest
|
|
|
|
- docker push $CI_REGISTRY_IMAGE:latest
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2023-05-27 12:19:20 +00:00
|
|
|
exists:
|
2023-05-27 12:08:47 +00:00
|
|
|
- Dockerfile
|