-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
35 lines (35 loc) · 1.1 KB
/
.gitlab-ci.yml
File metadata and controls
35 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
image: docker:27.5.1
services:
- name: docker:27.5.1-dind
command: [ "--tls=false", "--mtu=1240" ]
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_REGISTRY: registry.nosi.cv
DOCKER_PROJECT: portal-igrp
stages:
- build
- deploy
build_docker_image:
stage: build
only:
- main
script:
- docker login -u "$DOCKER_REGISTRY_USERNAME" -p "$DOCKER_REGISTRY_PASSWORD" "$DOCKER_REGISTRY"
- docker build -t $DOCKER_REGISTRY/$DOCKER_PROJECT/docs_prod .
- docker tag $DOCKER_REGISTRY/$DOCKER_PROJECT/docs_prod $DOCKER_REGISTRY/$DOCKER_PROJECT/docs_prod:$CI_PIPELINE_ID
- docker push $DOCKER_REGISTRY/$DOCKER_PROJECT/docs_prod
- docker push $DOCKER_REGISTRY/$DOCKER_PROJECT/docs_prod:$CI_PIPELINE_ID
deploy:
image: gcc:latest
stage: deploy
only:
- main
script:
- |
curl -u "$DEPLOY_USER:$DEPLOY_PASSWORD" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
'https://manager.nosi.cv/v3/project/c-kthdc:p-tn7qs/workloads/deployment:portal-igrp:docs?action=redeploy'