diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a13499e3d9a36efb2886a4a8ba5a67b13275a0e..efedc6e6c8520fe556b6654ea6c29b09543a3f1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,10 @@ stages: - build_test - release + - deploy + +include: + - remote: 'https://api.r2devops.io/job/r/gitlab/r2devops/hub/docker_build@latest.yaml' check-format: stage: build_test @@ -70,4 +74,15 @@ release-macos-x86: LDD_CMD: otool -L tags: - macos_mx - retry: 1 # First-time OpenSSL build will fail rust build \ No newline at end of file + retry: 1 # First-time OpenSSL build will fail rust build + +docker_build: + stage: deploy + variables: + COMMIT_CREATE_LATEST: "true" + IMAGE_TAG: "v1.19.2-debug" + retry: 2 + dependencies: + - release-linux + tags: + - buildonly \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cac1487dc5211c77bfea9f835f6e5459e919a503..41876be6906d63ce0b59b44dc6e42f5862baeaa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,2 @@ -FROM rust:alpine as cargo-build - -RUN apk update -RUN apk add --no-cache openssl-dev musl-dev - -WORKDIR /home/rust/src -COPY ./Cargo.toml ./Cargo.toml -COPY ./Cargo.lock ./Cargo.lock -COPY ./src ./src -COPY ./i18n ./i18n -COPY ./i18n.toml ./i18n.toml -RUN rustup target add x86_64-unknown-linux-musl - -FROM cargo-build as release-dev -RUN cargo build --target x86_64-unknown-linux-musl -RUN cargo test - -FROM cargo-build as release-prod -RUN cargo build --target x86_64-unknown-linux-musl --release - -FROM alpine:latest as image-dev -COPY --from=release-dev /home/rust/src/target/x86_64-unknown-linux-musl/debug/gitlab-project-doctor /usr/local/bin -RUN gitlab-project-doctor --help - -FROM alpine:latest as image-prod -COPY --from=release-prod /home/rust/src/target/x86_64-unknown-linux-musl/release/gitlab-project-doctor /usr/local/bin +FROM alpine:latest +COPY ./target/x86_64-unknown-linux-musl/release/gitlab-project-doctor /usr/local/bin