infrastructure/.gitlab-ci.yml

47 lines
2.1 KiB
YAML
Raw Normal View History

2020-12-02 11:00:46 +00:00
.build: &build
image: docker:latest
stage: build
script:
- docker login -u gitlab-ci-token -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
- docker build -f "${DOCKERFILE}" -t "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_SHA:0:8}" .
- docker tag "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_SHA:0:8}" "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}"
- docker push "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_SHA:0:8}"
- docker push "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}"
2020-12-02 20:10:40 +00:00
- if [[ "${CI_COMMIT_REF_SLUG}" == "main" ]]; then docker tag "${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}" "${CI_REGISTRY_IMAGE}/${NAME}:latest" && docker push "${CI_REGISTRY_IMAGE}/${NAME}:latest"; fi
2020-12-02 11:00:46 +00:00
signal-server:
2018-12-01 23:23:22 +00:00
image: docker:latest
stage: build
script:
2019-10-17 04:37:27 +00:00
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
2018-12-02 00:03:18 +00:00
- docker build -f signal-server.Dockerfile -t ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} .
2019-10-17 04:33:35 +00:00
- export VERSION=$(docker run ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} java -jar /usr/share/TextSecureServer.jar -v)
2018-12-01 23:23:22 +00:00
- docker tag ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_REF_SLUG}
- docker tag ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8} ${CI_REGISTRY_IMAGE}/signal-server:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_SHA:0:8}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${CI_COMMIT_REF_SLUG}
- docker push ${CI_REGISTRY_IMAGE}/signal-server:${VERSION}
2018-12-03 17:34:46 +00:00
- echo "docker pull ${CI_REGISTRY_IMAGE}/signal-server:${VERSION}"
2020-12-02 23:52:26 +00:00
allow_failure: true
2020-12-02 11:00:46 +00:00
testhelper:
<<: *build
variables:
DOCKERFILE: "testhelper.Dockerfile"
NAME: "testhelper"
2020-12-02 23:52:26 +00:00
allow_failure: true
2020-12-02 11:00:46 +00:00
builder-image:aarch64:
<<: *build
tags: [arm-docker-builder]
variables:
DOCKERFILE: "signald-builder.Dockerfile"
2020-12-02 23:28:26 +00:00
NAME: "signald-builder-arm"
builder-image-alpine:aarch64:
<<: *build
tags: [arm-docker-builder]
variables:
DOCKERFILE: "signald-builder-alpine.Dockerfile"
NAME: "signald-builder-alpine-arm"