Add release job & update deploy job
This commit is contained in:
parent
cba167c98c
commit
7adb1cddb8
4 changed files with 16 additions and 8 deletions
|
|
@ -2,6 +2,7 @@ stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- lint
|
- lint
|
||||||
|
- release
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
|
@ -25,4 +26,5 @@ include:
|
||||||
- local: '/gitlab-ci/build.yml'
|
- local: '/gitlab-ci/build.yml'
|
||||||
- local: '/gitlab-ci/test.yml'
|
- local: '/gitlab-ci/test.yml'
|
||||||
- local: '/gitlab-ci/lint.yml'
|
- local: '/gitlab-ci/lint.yml'
|
||||||
|
- local: '/gitlab-ci/release.yml'
|
||||||
- local: '/gitlab-ci/deploy.yml'
|
- local: '/gitlab-ci/deploy.yml'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,3 @@ static:
|
||||||
- npm install
|
- npm install
|
||||||
script:
|
script:
|
||||||
- npm run build
|
- npm run build
|
||||||
only:
|
|
||||||
refs:
|
|
||||||
- development
|
|
||||||
- merge_requests
|
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@ deploy:
|
||||||
environment:
|
environment:
|
||||||
name: production
|
name: production
|
||||||
url: rss.fudiggity.nl
|
url: rss.fudiggity.nl
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
before_script:
|
before_script:
|
||||||
- pip install ansible --quiet
|
- pip install ansible --quiet
|
||||||
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.fudiggity.nl/sonny/ansible-playbooks.git deployment
|
- git clone https://git.fudiggity.nl/sonny/newsreader.git deployment
|
||||||
- mkdir /root/.ssh
|
- mkdir /root/.ssh
|
||||||
- echo "192.168.178.63 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILbtcdgJBhVCKsO88cV19EYefDTopdYejEQCp1pYr1Ga" > /root/.ssh/known_hosts
|
- echo "$DEPLOY_HOST_KEY" > /root/.ssh/known_hosts
|
||||||
- echo "$DEPLOY_KEY" > deployment/deploy_key && chmod 0600 deployment/deploy_key
|
- echo "$DEPLOY_KEY" > deployment/deploy_key && chmod 0600 deployment/deploy_key
|
||||||
- mkdir /root/.vaults
|
- mkdir /root/.vaults
|
||||||
- echo "$VAULT_PASSWORD" > /root/.vaults/newsreader && chmod 0600 /root/.vaults/newsreader
|
- echo "$VAULT_PASSWORD" > /root/.vaults/newsreader && chmod 0600 /root/.vaults/newsreader
|
||||||
|
|
@ -20,5 +22,3 @@ deploy:
|
||||||
--user ansible
|
--user ansible
|
||||||
--private-key deployment/deploy_key
|
--private-key deployment/deploy_key
|
||||||
--vault-password-file /root/.vaults/newsreader
|
--vault-password-file /root/.vaults/newsreader
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
|
||||||
10
gitlab-ci/release.yml
Normal file
10
gitlab-ci/release.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- echo 'running release_job'
|
||||||
|
release:
|
||||||
|
name: 'Release $CI_COMMIT_TAG'
|
||||||
|
ref: '$CI_COMMIT_TAG'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue