update pipeline
This commit is contained in:
@@ -1,50 +1,17 @@
|
|||||||
image: docker:20.10.16
|
include: 'microservice.yaml'
|
||||||
|
|
||||||
variables:
|
|
||||||
DOCKER_HOST: tcp://docker:2376
|
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
|
||||||
DOCKER_TLS_VERIFY: 1
|
|
||||||
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker:20.10.16-dind
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
- migration
|
||||||
|
|
||||||
build-job:
|
migration-dev:
|
||||||
stage: build
|
stage: migration
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
script:
|
|
||||||
- docker info
|
|
||||||
- docker build -t docker-registry.dopcore.com/$CI_PROJECT_PATH .
|
|
||||||
- echo "$CI_REGISTRY_PASSWORD" | docker login docker-registry.dopcore.com -u "$CI_REGISTRY_USER" --password-stdin
|
|
||||||
- docker push docker-registry.dopcore.com/$CI_PROJECT_PATH
|
|
||||||
|
|
||||||
deploy-dev:
|
|
||||||
stage: deploy
|
|
||||||
image: dtzar/helm-kubectl:latest
|
image: dtzar/helm-kubectl:latest
|
||||||
environment:
|
|
||||||
name: development
|
|
||||||
url: https://astra-dev.dopcore.com/
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
script:
|
script:
|
||||||
- export $(xargs < deploy/.env)
|
|
||||||
- envsubst < deploy/values.template.yaml > deploy/values.yaml
|
|
||||||
- "echo 'envs: [' >> deploy/values.yaml"
|
|
||||||
- kubectl get svc -o=custom-columns=NAME:.metadata.name,PORT:.spec.ports[0].port | grep astra | awk '{ print "{\"name\":\""toupper($1)"\",\"value\":\"http://"$1".default.svc.cluster.local:"$2"\"}," }' >> deploy/values.yaml
|
|
||||||
- "echo ']' >> deploy/values.yaml"
|
|
||||||
- cat deploy/values.yaml
|
|
||||||
- kubectl version
|
|
||||||
- helm upgrade --install $CI_PROJECT_TITLE deploy
|
|
||||||
- kubectl rollout restart deploy/$CI_PROJECT_TITLE
|
|
||||||
- sleep 30
|
- sleep 30
|
||||||
- kubectl exec deploy/$CI_PROJECT_TITLE alembic upgrade head
|
- kubectl exec deploy/$CI_PROJECT_TITLE alembic upgrade head
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ stages:
|
|||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build-job:
|
build-dev:
|
||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|||||||
Reference in New Issue
Block a user