Skip to content
Snippets Groups Projects
Verified Commit 2d488404 authored by Geoffrey Arthaud's avatar Geoffrey Arthaud
Browse files

Add Docker release from binary release

parent 38e9eeaa
No related branches found
No related tags found
No related merge requests found
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment