Files
astra-users/.gitlab-ci.yml
2023-06-30 17:52:44 +03:00

57 lines
1.9 KiB
YAML

image: docker:20.10.16
variables:
# When using dind service, you must instruct Docker to talk with
# the daemon started inside of the service. The daemon is available
# with a network connection instead of the default
# /var/run/docker.sock socket.
DOCKER_HOST: tcp://docker:2376
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/services/#accessing-the-services.
# If you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
# the variable must be set to tcp://localhost:2376 because of how the
# Kubernetes executor connects services to the job container
# DOCKER_HOST: tcp://localhost:2376
#
# Specify to Docker where to create the certificates. Docker
# creates them automatically on boot, and creates
# `/certs/client` to share between the service and job
# container, thanks to volume mount from config.toml
DOCKER_TLS_CERTDIR: "/certs"
# These are usually specified by the entrypoint, however the
# Kubernetes executor doesn't run entrypoints
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4125
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
services:
- docker:20.10.16-dind
stages:
- build
- deploy
build-job:
stage: build
tags:
- docker
only:
- master
script:
- docker info
- docker build -t docker-registry.dopcore.com/andrusyakka/astra-users .
- echo "$DOCKER_PASSWORD" | docker login docker-registry.dopcore.com -u "$DOCKER_USER" --password-stdin
- docker push docker-registry.dopcore.com/andrusyakka/astra-users
deploy-job:
stage: deploy
image: dtzar/helm-kubectl:latest
tags:
- docker
only:
- master
script:
- kubectl version
- helm upgrade --install astra-users deploy
- kubectl rollout restart deploy/astra-users