Streamline CI

This commit is contained in:
Aarni Halinen
2019-12-18 16:49:38 +02:00
parent 5c58454529
commit af01804a7f
+9 -10
View File
@@ -1,7 +1,6 @@
stages: stages:
- setup - setup
- lint - qa
- build
- test - test
- publish - publish
- deploy - deploy
@@ -19,19 +18,19 @@ setup:
es:lint: es:lint:
image: node:12 image: node:12
stage: lint stage: qa
script: script:
- npm run lint:es - npm run lint:es
sass:lint: sass:lint:
image: node:12 image: node:12
stage: lint stage: qa
script: script:
- npm run lint:sass - npm run lint:sass
ts:build: build:
image: node:12 image: node:12
stage: build stage: qa
script: script:
- API_URL=http://web.sik.party:8000/api npm run build - API_URL=http://web.sik.party:8000/api npm run build
@@ -49,7 +48,7 @@ test:e2e:
script: script:
- API_URL=http://web.sik.party:8000/api npm run test:e2e - API_URL=http://web.sik.party:8000/api npm run test:e2e
publish: publish:dev:
stage: publish stage: publish
image: docker:stable image: docker:stable
services: services:
@@ -62,7 +61,7 @@ publish:
- docker build . -t "$IMAGE_NAME":latest - docker build . -t "$IMAGE_NAME":latest
- docker push "$IMAGE_NAME":latest - docker push "$IMAGE_NAME":latest
publish_prod: publish:prod:
stage: publish stage: publish
image: docker:stable image: docker:stable
services: services:
@@ -75,7 +74,7 @@ publish_prod:
- docker build . -f Dockerfile.prod -t "$IMAGE_NAME":prod - docker build . -f Dockerfile.prod -t "$IMAGE_NAME":prod
- docker push "$IMAGE_NAME":prod - docker push "$IMAGE_NAME":prod
deploy_dev: deploy:dev:
stage: deploy stage: deploy
image: alpine:latest image: alpine:latest
environment: environment:
@@ -97,7 +96,7 @@ deploy_dev:
- ssh $DEV_SSH_USER@$DEV_SSH_HOST "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY" - ssh $DEV_SSH_USER@$DEV_SSH_HOST "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY"
- ssh $DEV_SSH_USER@$DEV_SSH_HOST "bash ~/deployment-frontend/deploy_dev.sh \"$IMAGE_NAME:latest\"" - ssh $DEV_SSH_USER@$DEV_SSH_HOST "bash ~/deployment-frontend/deploy_dev.sh \"$IMAGE_NAME:latest\""
deploy_production: deploy:prod:
stage: deploy stage: deploy
image: docker:stable image: docker:stable
only: only: