Commit 8b4cb4a2 authored by Finn Herzfeld's avatar Finn Herzfeld 🌵

Merge branch 'docker-test' into 'master'

Automatic docker builds

See merge request !86
parents cef30946 5a8803ee
Pipeline #2952 passed with stages
in 11 minutes and 35 seconds
......@@ -43,7 +43,6 @@ build-java-11:
script:
- make installDist
deb:build:
stage: build
image: registry.git.callpipe.com/finn/debian-repo-builder:latest
......@@ -61,6 +60,28 @@ deb:build:
paths:
- "signald_*"
build-docker:
image: docker:latest
stage: build
tags:
- docker-builder
only:
- branches
- tags
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- if [[ ! -z "${DOCKER_HUB_USERNAME}" ]]; then docker login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD}; fi
script:
- docker build -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} .
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
- if [[ "${CI_COMMIT_REF_NAME}" == "master" ]]; then docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} ${CI_REGISTRY_IMAGE}:latest; fi;
- if [[ "${CI_COMMIT_REF_NAME}" == "master" ]]; then docker push ${CI_REGISTRY_IMAGE}:latest; fi;
- if [[ ! -z "${DOCKER_HUB_USERNAME}" ]]; then docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} ${DOCKER_HUB_USERNAME}/signald:${CI_COMMIT_REF_NAME}; fi
- if [[ ! -z "${DOCKER_HUB_USERNAME}" ]]; then docker push ${DOCKER_HUB_USERNAME}/signald:${CI_COMMIT_REF_NAME}; fi
- if [[ ! -z "${DOCKER_HUB_USERNAME}" ]] && [[ "${CI_COMMIT_REF_NAME}" == "master" ]]; then docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} ${DOCKER_HUB_USERNAME}/signald:latest; fi
- if [[ ! -z "${DOCKER_HUB_USERNAME}" ]] && [[ "${CI_COMMIT_REF_NAME}" == "master" ]]; then docker push ${DOCKER_HUB_USERNAME}/signald:latest; fi
deb:publish:
stage: publish
image: registry.git.callpipe.com/finn/debian-repo-builder:latest
......
......@@ -3,10 +3,10 @@ FROM gradle:jdk${JAVA_VERSION:-8}
COPY . /tmp/src
WORKDIR /tmp/src
USER root
RUN gradle -Dorg.gradle.daemon=false build
RUN tar xf build/distributions/signald.tar -C /opt
USER root
RUN ln -sf /opt/signald/bin/signald /usr/local/bin/
# basically `make setup`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment