mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-15 06:41:46 +08:00
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
image: docker:latest
|
|
|
|
# Use the OverlayFS driver for improved performance.
|
|
variables:
|
|
DOCKER_DRIVER: overlay
|
|
|
|
services:
|
|
- docker:dind
|
|
|
|
before_script:
|
|
- mkdir -pv /home/docker
|
|
- echo $DOCKER_CA_PEM >> /home/docker/ca.pem.base64
|
|
- echo $DOCKER_CERT >> /home/docker/cert.pem.base64
|
|
- echo $DOCKER_KEY >> /home/docker/key.pem.base64
|
|
- base64 -d /home/docker/ca.pem.base64 >> /home/docker/ca.pem
|
|
- base64 -d /home/docker/cert.pem.base64 >> /home/docker/cert.pem
|
|
- base64 -d /home/docker/key.pem.base64 >> /home/docker/key.pem
|
|
- alias secure-docker="docker -H tcp://glados.minidigger.me:4243 --tlsverify --tlscacert=/home/docker/ca.pem --tlscert=/home/docker/cert.pem --tlskey=/home/docker/key.pem"
|
|
|
|
cache:
|
|
paths:
|
|
- .m2/repository/
|
|
- target/
|
|
|
|
build:
|
|
stage: build
|
|
variables:
|
|
SERVICE_NAME: hangarnew
|
|
script:
|
|
- apk add --no-cache docker-compose
|
|
- cd docker
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
- docker-compose build
|
|
- docker-compose push
|
|
- secure-docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
- secure-docker stack deploy --with-registry-auth --compose-file=docker-compose.yml ${SERVICE_NAME}
|
|
only:
|
|
- master
|