Skip to content
Snippets Groups Projects
Commit 7c134b8c authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

ci: update gitlab ci

parent 1ccc0087
No related branches found
No related tags found
2 merge requests!34Sprint 17 features,!33CI - switch env to kubernetes
This commit is part of merge request !34. Comments created here will be created in the context of that merge request.
...@@ -47,40 +47,32 @@ test: ...@@ -47,40 +47,32 @@ test:
- cd ${HOME} - cd ${HOME}
- npm run test - npm run test
test:qa: push:qa:
image: $DOCKER_REPO:latest image: docker:latest
stage: test stage: push
only: only:
- develop - develop
variables:
GIT_STRATEGY: none
script:
- cd ${HOME}
- npm run test
environment:
name: qa
url: http://qa.faraday.hindawi.com
test:production:
image: $DOCKER_REPO:production
stage: test
only:
- master
variables:
GIT_STRATEGY: none
script: script:
- cd ${HOME} # Setup
- npm run test - export AWS_REGION="eu-west-1"
environment: - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
name: production - export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
url: http://faraday.hindawi.com - apk update
- apk --no-cache add --update curl python python-dev py-pip
- pip install awscli --upgrade --user
- export PATH=~/.local/bin:/usr/bin/:$PATH
# AUTH
- CERT=`aws ecr get-login --no-include-email --region ${AWS_REGION}`
- ${CERT}
# Tag
- docker tag $DOCKER_REPO:$CI_COMMIT_SHA $DOCKER_REPO:latest
- docker push $DOCKER_REPO:latest
push:qa: push:staging:
image: docker:latest image: docker:latest
stage: push stage: push
only: only:
- ci - develop
script: script:
# Setup # Setup
- export AWS_REGION="eu-west-1" - export AWS_REGION="eu-west-1"
...@@ -94,14 +86,14 @@ push:qa: ...@@ -94,14 +86,14 @@ push:qa:
- CERT=`aws ecr get-login --no-include-email --region ${AWS_REGION}` - CERT=`aws ecr get-login --no-include-email --region ${AWS_REGION}`
- ${CERT} - ${CERT}
# Tag # Tag
- docker tag $DOCKER_REPO:$CI_COMMIT_SHA $DOCKER_REPO:latest - docker tag $DOCKER_REPO:$CI_COMMIT_SHA $DOCKER_REPO:staging
- docker push $DOCKER_REPO:latest - docker push $DOCKER_REPO:staging
deploy:aws-qa: deploy:aws-qa:
stage: deploy stage: deploy
when: manual when: manual
only: only:
- ci - develop
script: script:
- export AWS_REGION="eu-west-1" - export AWS_REGION="eu-west-1"
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
...@@ -119,7 +111,7 @@ deploy:qa: ...@@ -119,7 +111,7 @@ deploy:qa:
stage: deploy stage: deploy
when: manual when: manual
only: only:
- ci - develop
variables: variables:
PACKAGE_NAME: xpub-faraday PACKAGE_NAME: xpub-faraday
IMAGE_TAG: latest IMAGE_TAG: latest
...@@ -129,3 +121,19 @@ deploy:qa: ...@@ -129,3 +121,19 @@ deploy:qa:
script: script:
- source deploy.sh - source deploy.sh
- create_deployment - create_deployment
deploy:staging:
image: pubsweet/deployer:latest
stage: deploy
when: manual
only:
- master
variables:
PACKAGE_NAME: xpub-faraday
IMAGE_TAG: staging
environment:
name: staging
url: http://faraday.hindawi.com
script:
- source deploy.sh
- create_deployment
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