use deploy container

This sets up gpg/usign once and reuses it for the ~160 sdk/ib containes

Signed-off-by: Paul Spooren <mail@aparcar.org>
pull/38/head
Paul Spooren 2019-11-06 12:25:33 -10:00
parent 806910a4b8
commit 54d80c0363
3 changed files with 23 additions and 3 deletions

View File

@ -14,8 +14,12 @@ stages:
- pre-build
- build
- test
- build-deploy-container
- deploy
build deploy container:
extends: .build-deploy-container
check scripts with shellcheck:
stage: pre-build
extends: .openwrt-shellcheck

View File

@ -8,14 +8,22 @@
- bash docker-common.sh
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
.deploy:
.build-deploy-container:
image: docker:latest
stage: build-deploy-container
services:
- docker:dind
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build -t "$CI_REGISTRY_IMAGE:deploy" -f Dockerfile.deploy .
- docker push "$CI_REGISTRY_IMAGE:deploy"
.deploy:
image: "$CI_REGISTRY_IMAGE:deploy"
stage: deploy
only:
- master
services:
- docker:dind
before_script:
- apk add curl rsync bash gnupg outils-signify
- bash docker-common.sh
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"

View File

@ -0,0 +1,8 @@
FROM docker:latest
RUN apk add curl rsync bash gnupg outils-signify
RUN mkdir -p /deploy
COPY docker-common.sh /deploy
WORKDIR /deploy
RUN chmod +x ./docker-common.sh
RUN ./docker-common.sh