2023-04-20 10:43:42 +02:00
|
|
|
|
|
|
|
variables:
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker:dind
|
|
|
|
entrypoint: ["dockerd-entrypoint.sh", "--tls=false"]
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
# - test
|
|
|
|
- pack
|
|
|
|
|
|
|
|
cargo-build:
|
|
|
|
stage: build
|
|
|
|
image: rust:slim
|
|
|
|
variables:
|
|
|
|
CARGO_HOME: $CI_PROJECT_DIR/.cargo
|
|
|
|
before_script:
|
|
|
|
script:
|
|
|
|
- cargo build --release
|
|
|
|
cache:
|
|
|
|
key: $CI_COMMIT_REF_SLUG
|
|
|
|
paths:
|
|
|
|
- target/
|
|
|
|
- .cargo/registry/index/
|
|
|
|
- .cargo/registry/cache/
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2023-04-20 10:51:36 +02:00
|
|
|
- target/release/bin
|
2023-04-20 10:43:42 +02:00
|
|
|
|
|
|
|
docker:
|
|
|
|
stage: pack
|
|
|
|
image: docker:latest
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
- docker build --network host -t $CI_REGISTRY_IMAGE/master . -f Dockerfile
|
|
|
|
- docker push $CI_REGISTRY_IMAGE/master
|
|
|
|
dependencies:
|
|
|
|
- cargo-build
|