Skip to content
Snippets Groups Projects
Commit f4f39207 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add management of image with gitlab docker registry

parent a35c7e39
Branches
Tags
No related merge requests found
Pipeline #
......@@ -8,7 +8,10 @@ build_development:
- master
script:
- export NODE_ENV=DEV
- docker-compose --project-name service-authentication-dev build
- export TAG=dev
- docker-compose build
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose push
deploy_development:
stage: deploy
......@@ -16,23 +19,22 @@ deploy_development:
- master
script:
- export NODE_ENV=DEV
- docker-compose --project-name service-authentication-dev up -d
build_staging:
stage: build
only:
- staging
script:
- export NODE_ENV=REC
- sed -i 's/DEV_/REC_/g' docker-compose.yml
- docker-compose --project-name service-authentication-rec build
- export TAG=dev
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose pull
- docker-compose --project-name service-authentication-${TAG} up -d
deploy_staging:
stage: deploy
only:
- staging
- master
when: manual
script:
- export TAG=staging
- export NODE_ENV=REC
- sed -i 's/DEV_/REC_/g' docker-compose.yml
- docker-compose --project-name service-authentication-rec up -d
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- TAG=dev docker-compose pull
- docker tag $CI_REGISTRY/refonte-data/service-authentication:dev $CI_REGISTRY/refonte-data/service-authentication:${TAG}
- docker push $CI_REGISTRY/refonte-data/service-authentication:${TAG}
- docker-compose --project-name service-authentication-${TAG} up -d
\ No newline at end of file
......@@ -2,8 +2,9 @@ version: '3.1'
services:
service-authentication:
container_name: service-authentication-${NODE_ENV}
container_name: service-authentication-${TAG}
build: .
image: registry.alpha.grandlyon.com/refonte-data/service-authentication:${TAG}
ports:
- ${DEV_SERVICE_PORT}:3000
environment:
......@@ -23,7 +24,7 @@ services:
- redis
redis:
container_name: redis-${NODE_ENV}
container_name: redis-${TAG}
image: redis:5.0.0-alpine
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment