Try e2e CI test and add placeholder deploy prod config

This commit is contained in:
Aarni Halinen
2019-11-09 01:14:00 +02:00
parent 6a9a3aec92
commit 7f69e839af
2 changed files with 42 additions and 24 deletions
+27 -24
View File
@@ -21,11 +21,11 @@ setup:
# script: # script:
# - npm run test:unit # - npm run test:unit
# test:e2e: test:e2e:
# image: node image: node:12-browsers
# stage: test stage: test
# script: script:
# - npm run test:e2e - npm run test:e2e
es:lint: es:lint:
image: node:12 image: node:12
@@ -74,22 +74,25 @@ 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\"" - ssh $DEV_SSH_USER@$DEV_SSH_HOST "bash ~/deployment-frontend/deploy_dev.sh \"$IMAGE_NAME\""
# deploy_production: deploy_production:
# stage: deploy stage: deploy
# image: alpine:latest image: docker:stable
# environment: only:
# name: production - production
# url: https://sika.sahkoinsinoorikilta.fi environment:
# when: manual name: production
# only: url: sika.sik.party
# - master when: manual
# before_script: variables:
# - pwd DOCKER_HOST: $CI_DOCKER_HOST
# - apk add --update openssh DOCKER_TLS_VERIFY: 1
# - ssh -V before_script:
# - mkdir -p ~/.ssh - mkdir -p ~/.docker
# - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - echo "$TLSCACERT" > ~/.docker/ca.pem
# - chmod 600 ~/.ssh/id_rsa - echo "$TLSCERT" > ~/.docker/cert.pem
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - echo "$TLSKEY" > ~/.docker/key.pem
# script: - docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
# - ssh $PROD_SSH_USER@$PROD_SSH_HOST "zsh ~/deploy-frontend.sh" script:
- docker stack deploy --with-registry-auth -c stack-compose.yml "$SERVICE_NAME"
after_script:
- docker logout "$CI_REGISTRY"
+15
View File
@@ -0,0 +1,15 @@
version: '3.4'
services:
frontend:
image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-frontend:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
update_config:
order: start-first
ports:
- 3000:3000
environment:
API_URL: ${API_URL}