feat: Added gitlab CI config and Dockerfile
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
df49ace55b
commit
06ed04fbbb
31
.gitlab-ci.yml
Normal file
31
.gitlab-ci.yml
Normal file
@ -0,0 +1,31 @@
|
||||
image: docker:latest
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
stages:
|
||||
- release
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2376
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
CONTAINER_BRANCH_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
||||
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker build . -t $CONTAINER_BRANCH_IMAGE
|
||||
- docker push $CONTAINER_BRANCH_IMAGE
|
||||
|
||||
release-master:
|
||||
stage: release
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker build . -t $CONTAINER_RELEASE_IMAGE
|
||||
- docker push $CONTAINER_RELEASE_IMAGE
|
||||
only:
|
||||
- master
|
||||
|
||||
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM rust:latest AS builder
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:stable-slim
|
||||
|
||||
RUN apt update && apt install -y ca-certificates openssl && apt clean
|
||||
|
||||
COPY --from=builder /root/target/release/lb-influx-connector /root/lb-influx-connector
|
||||
|
||||
CMD ["/root/lb-influx-connector"]
|
Loading…
Reference in New Issue
Block a user