mirror of
https://github.com/pfzetto/rebacs
synced 2024-12-21 22:29:32 +01:00
ci
This commit is contained in:
parent
21f0c705fe
commit
77bc8eb6a7
2 changed files with 38 additions and 0 deletions
34
.gitlab-ci.yml
Normal file
34
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,34 @@
|
|||
variables:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
|
||||
services:
|
||||
- name: docker:dind
|
||||
entrypoint: ["dockerd-entrypoint.sh", "--tls=false"]
|
||||
|
||||
stages:
|
||||
- build
|
||||
- pack
|
||||
|
||||
cargo-build:
|
||||
stage: build
|
||||
image: rust:slim-bookworm
|
||||
before_script:
|
||||
- apt update && apt install protobuf-compiler -y
|
||||
script:
|
||||
- cargo build --release
|
||||
artifacts:
|
||||
paths:
|
||||
- target/release/rebacs
|
||||
|
||||
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
|
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
|||
FROM debian:bookworm-slim AS final
|
||||
WORKDIR /app
|
||||
COPY ./target/release/rebacs ./server
|
||||
CMD [ "/app/server" ]
|
Loading…
Reference in a new issue