Verified Commit b9ee0835 authored by Daniel Sonck's avatar Daniel Sonck
Browse files

Enable release build

parent 94f04dd1
Pipeline #418 failed with stages
in 5 minutes and 29 seconds
......@@ -18,10 +18,13 @@ app:prepare:
reports:
dotenv:
- variables.env
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" || $CI_COMMIT_BRANCH == "development" || $CI_COMMIT_TAG =~ /^release\//'
when: on_success
app:build:
cache:
key: go
key: ${CI_COMMIT_REF_SLUG}-go
paths:
- .go
image: quay.io/buildah/stable:v1.16.0
......@@ -41,12 +44,15 @@ app:build:
reports:
junit: target/reports/tests.xml
cobertura: target/reports/cobertura.xml
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" || $CI_COMMIT_BRANCH == "development" || $CI_COMMIT_TAG =~ /^release\//'
when: on_success
include: /infra/.gitlab-ci.yml
app:publish:dev:
cache:
key: node
key: ${CI_COMMIT_REF_SLUG}-node
paths:
- node_modules
image: node:15.2.1-alpine3.11
......@@ -58,8 +64,29 @@ app:publish:dev:
- kubernetes
- cluster
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "development"'
script:
- cd apollo
- yarn install --lockfile-only
- yarn run push --serviceName=playlist --serviceURL=$PLAYLIST_SERVICE_URL --endpoint=$PLAYLIST_SERVICE_URL --variant=development
app:publish:pro:
cache:
key: ${CI_COMMIT_REF_SLUG}-node
paths:
- node_modules
image: node:15.2.1-alpine3.11
stage: publish
needs:
- job: deploy:apply:pro
artifacts: true
tags:
- kubernetes
- cluster
rules:
- if: '$CI_COMMIT_TAG =~ /^release\//'
when: on_success
script:
- cd apollo
- yarn install --lockfile-only
- yarn run push --serviceName=playlist --serviceURL=$SERVICE_URL --endpoint=$SERVICE_URL --variant=development
\ No newline at end of file
- yarn run push --serviceName=playlist --serviceURL=$PLAYLIST_SERVICE_URL --endpoint=$PLAYLIST_SERVICE_URL --variant=production
\ No newline at end of file
......@@ -19,6 +19,9 @@ deploy:init:
stage: prepare
script:
- gitlab-terraform init
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" || $CI_COMMIT_BRANCH == "development" || $CI_COMMIT_TAG =~ /^release\//'
when: on_success
deploy:validate:
<<: *deploy_tpl
......@@ -28,6 +31,9 @@ deploy:validate:
stage: validate
script:
- gitlab-terraform validate
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" || $CI_COMMIT_BRANCH == "development" || $CI_COMMIT_TAG =~ /^release\//'
when: on_success
deploy:plan:dev:
<<: *deploy_tpl
......@@ -42,7 +48,7 @@ deploy:plan:dev:
action: prepare
auto_stop_in: 7 days
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "development"'
when: on_success
script:
- echo "playlist_version = \"$VERSION\"" > playlist.version.auto.tfvars
......@@ -70,7 +76,7 @@ deploy:apply:dev:
- gitlab-terraform apply
- echo -n "SERVICE_URL=$(gitlab-terraform output -json graphql-service | jq -r '"http://"+.address+":"+(.port | tostring)+"/"')" > deploy-info.env
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "development"'
when: on_success
artifacts:
reports:
......@@ -90,5 +96,53 @@ deploy:stop:dev:
name: development
action: stop
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_BRANCH == "development"'
when: manual
deploy:plan:pro:
<<: *deploy_tpl
needs:
- job: deploy:validate
artifacts: false
- job: app:prepare
artifacts: true
stage: build
environment:
name: production
action: prepare
rules:
- if: '$CI_COMMIT_TAG =~ /^release\//'
when: on_success
script:
- echo "playlist_version = \"$VERSION\"" > playlist.version.auto.tfvars
- gitlab-terraform plan
- gitlab-terraform plan-json
artifacts:
name: plan-dev
paths:
- ${TF_ROOT}/plan.cache
- ${TF_ROOT}/player.version.auto.tfvars
deploy:apply:pro:
<<: *deploy_tpl
needs:
- job: deploy:plan:pro
artifacts: true
- job: app:build
artifacts: false
stage: deploy
environment:
name: production
script:
- gitlab-terraform apply
- echo -n "PLAYLIST_SERVICE_URL=$(gitlab-terraform output -json graphql-service | jq -r '"http://"+.address+":"+(.port | tostring)+"/"')" > deploy-info.env
- gitlab-terraform output -json service > player-service.json
rules:
- if: '$CI_COMMIT_TAG =~ /^release\//'
when: on_success
artifacts:
paths:
- player-service.json
reports:
dotenv:
- ${TF_ROOT}/deploy-info.env
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