Commit a92258c3 authored by José Gato Luis's avatar José Gato Luis
Browse files

Merge branch '19-implement-a-ci-cd-workflow' into development

parents 59633c3b a8bb0c0e
Pipeline #1727 failed with stages
in 53 seconds
......@@ -8,6 +8,7 @@ variables:
RANCHER_COMPOSE_TAR: "rancher-compose-linux-amd64-v0.12.5.tar.gz"
RANCHER_COMPOSE_DIR: "rancher-compose-v0.12.5"
PROJECT_NAME: "AEON-Platform "
AEON_SERVICE: "API Events-Manager"
stages:
- build
......@@ -56,13 +57,30 @@ deploy_job:
- ls -l ./$RANCHER_COMPOSE_DIR/
#- alias rancher-compose=$PWD/$RANCHER_COMPOSE_DIR/rancher-compose
- cd deployment
- ../$RANCHER_COMPOSE_DIR/rancher-compose --version
- ../$RANCHER_COMPOSE_DIR/rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --force-upgrade --pull -d API Events-Manager
- ../$RANCHER_COMPOSE_DIR/rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --confirm-upgrade -d API Events-Manager
- rancher-compose --version
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --force-upgrade --pull -d $AEON_SERVICE
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --confirm-upgrade -d $AEON_SERVICE
environment: Development-Rancher
only:
- development
deploy_job_prod:
stage: deploy
script:
- echo "Download rancher compose"
- wget $RANCHER_COMPOSE_DOWNLOAD
- tar -zxvf $RANCHER_COMPOSE_TAR
- ls -l ./$RANCHER_COMPOSE_DIR/
- alias rancher-compose=$PWD/$RANCHER_COMPOSE_DIR/rancher-compose
- echo $PWD
- alias
- cd deployment
- rancher-compose --version
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --force-upgrade --pull -d $AEON_SERVICE
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --confirm-upgrade -d $AEON_SERVICE
environment: Production-Rancher
only:
- production
deploy_clean_job:
stage: deploy_clean
......@@ -71,11 +89,25 @@ deploy_clean_job:
- wget --no-check-certificate $RANCHER_COMPOSE_DOWNLOAD
- tar -zxvf $RANCHER_COMPOSE_TAR
- ls -l ./$RANCHER_COMPOSE_DIR/
#- alias rancher-compose=$PWD/$RANCHER_COMPOSE_DIR/rancher-compose
- cd deployment
- alias rancher-compose=$PWD/$RANCHER_COMPOSE_DIR/rancher-compose
- cd deployment-dev
- echo "Something went wrong, rolling back upgraded service"
- ../$RANCHER_COMPOSE_DIR/rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --rollback -d API Events-Manager
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --rollback -d $AEON_SERVICE
when: on_failure
only:
- development
deploy_clean_job_prod:
stage: deploy_clean
script:
- echo "Download rancher compose"
- wget --no-check-certificate $RANCHER_COMPOSE_DOWNLOAD
- tar -zxvf $RANCHER_COMPOSE_TAR
- ls -l ./$RANCHER_COMPOSE_DIR/
- alias rancher-compose=$PWD/$RANCHER_COMPOSE_DIR/rancher-compose
- cd deployment
- echo "Something went wrong, rolling back upgraded service"
- rancher-compose --debug --project-name $PROJECT_NAME --url $RANCHER_URL --access-key $RANCHER_PUBLIC --secret-key $RANCHER_PRIVATE up --rollback -d $AEON_SERVICE
when: on_failure
only:
- production
version: '2'
volumes:
MONGO-Storage:
external: true
driver: rancher-nfs
AEON-Config-Volume:
external: true
driver: 'null'
RABBIT-Storage:
external: true
driver: rancher-nfs
services:
Proxy:
image: rancher/lb-service-haproxy:v0.7.5
ports:
- 3000:3000/tcp
- 8000:8000/tcp
- 7789:7789/tcp
depends_on:
- "API"
- "Dashboard"
- "Events-Manager"
labels:
io.rancher.scheduler.affinity:host_label: deviceID=Rancher-host4
io.rancher.container.agent.role: environmentAdmin
io.rancher.container.create_agent: 'true'
Mongo:
image: jgato/aeon-mongo:3.2.14
stdin_open: true
volumes:
- AEON-Config-Volume:/etc/aeon/config:ro
- MONGO-Storage:/data/db:nocopy
tty: true
user: nobody
labels:
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label: deviceid=Rancher-host4
Rabbit:
image: jgato/aeon-rabbitmq:3.6.6-management-alpine
hostname: localhost
stdin_open: true
volumes:
- AEON-Config-Volume:/etc/aeon/config:ro
- RABBIT-Storage:/var/lib/rabbitmq:nocopy
tty: true
ports:
- 15672:15672/tcp
user: nobody
labels:
io.rancher.container.pull_image: always
io.rancher.scheduler.affinity:host_label: deviceid=Rancher-host4
Dashboard:
image: jgato/aeon-dashboard:0.3.0-dev-alpine
stdin_open: true
volumes:
- AEON-Config-Volume:/etc/aeon/config/:ro
tty: true
command:
- start
depends_on:
- "API"
labels:
io.rancher.container.pull_image: always
API:
image: jgato/aeon-api:0.3.0-dev-alpine
stdin_open: true
volumes:
- AEON-Config-Volume:/etc/aeon/config/:ro
tty: true
links:
- Mongo:MONGO
- Rabbit:RABBIT
command:
- start
depends_on:
- "mongo"
- "rabbit"
labels:
io.rancher.container.pull_image: always
Events-Manager:
image: jgato/aeon-events-manager:0.3.0-dev-alpine
stdin_open: true
volumes:
- AEON-Config-Volume:/etc/aeon/config/:ro
tty: true
links:
- Mongo:MONGO
- Rabbit:RABBIT
command:
- start
depends_on:
- "mongo"
- "rabbit"
labels:
io.rancher.container.pull_image: always
version: '2'
services:
Proxy:
scale: 1
start_on_create: true
lb_config:
certs: []
default_cert: '*.atosresearch.eu'
port_rules:
- hostname: aeon-dev.atosresearch.eu
path: ''
priority: 1
protocol: https
service: API
source_port: 3000
target_port: 3000
- hostname: aeon-dev.atosresearch.eu
priority: 2
protocol: https
service: Dashboard
source_port: 8000
target_port: 8000
- hostname: aeon-dev.atosresearch.eu
path: ''
priority: 3
protocol: https
service: Events-Manager
source_port: 7789
target_port: 7789
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 42
unhealthy_threshold: 3
initializing_timeout: 60000
interval: 2000
reinitializing_timeout: 60000
Mongo:
scale: 1
start_on_create: true
Rabbit:
scale: 1
start_on_create: true
Dashboard:
scale: 3
start_on_create: true
API:
scale: 3
start_on_create: true
Events-Manager:
scale: 1
start_on_create: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment