Skip to content
Snippets Groups Projects
.gitlab-ci.yml 4.62 KiB
Newer Older
image: node:11
 - integration
 - acceptance
plup's avatar
plup committed
 - release

## TESTING ##

## VALIDATION ##

test1:
  stage: integration
  environment:
    name: test1
    url: https://test1.startinblox.com
    - echo "$APP_CONFIG_TEST1" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test1@astral.startinblox.com:~/front/
plup's avatar
plup committed
    - /^feature\/.*/
  when: manual
  tags:
test2:
  stage: integration
  environment:
    name: test2
    url: https://test2.startinblox.com
    - echo "$APP_CONFIG_TEST2" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test2@astral.startinblox.com:~/front/
plup's avatar
plup committed
    - /^feature\/.*/
  when: manual
  tags:
test3:
  stage: integration
  environment:
    name: test3
    url: https://test3.startinblox.com
  script:
    - echo "$APP_CONFIG_TEST3" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* test3@astral.startinblox.com:~/front/
  only:
plup's avatar
plup committed
    - /^feature\/.*/
  when: manual
  tags:
    - deploy

  stage: acceptance
  environment:
    name: stg1
    url: https://stg1.startinblox.com
  script:
    - echo "$APP_CONFIG_STG1" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg1@astral.startinblox.com:~/front/
  only:
    - /^release\/.*/
  when: manual
  stage: acceptance
  environment:
    name: stg2
    url: https://stg2.startinblox.com
    - echo "$APP_CONFIG_STG2" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* stg2@astral.startinblox.com:~/front/
    - /^release\/.*/
  when: manual
plup's avatar
plup committed
## RELEASE TAGGING ##

publish:
  stage: release
  script:
    - npm install -g semantic-release@v17 @semantic-release/gitlab
    - semantic-release
  only:
    - master
  tags:
    - deploy

## LIVE DEPLOYMENTS ##
community:
  stage: deployment
  environment:
    name: community
    url: https://community.startinblox.com
  script:
    - echo "$APP_CONFIG_COMMUNITY" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* community@astral.startinblox.com:~/front/
  only:
    - master
  when: manual
  tags:
    - deploy

plup's avatar
plup committed
etuc:
  stage: deployment
  environment:
    name: etuc
    url: https://app.digitalplatformobservatory.org
  script:
    - echo "$APP_CONFIG_DIGITALPLATFORMOBSERVATORY" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* etuc@ssh-etuc.happy-dev.fr:~/sib/www/
  only:
    - master
  when: manual
  tags:
    - deploy

nantes:
  stage: deployment
  environment:
    name: nantes
    url: https://app.nantes.happy-dev.fr
    - echo "$APP_CONFIG_NANTESHD" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* nantes@ssh-nantes.happy-dev.fr:~/sib/www/
  only:
    - master
  when: manual
  tags:
paris:
  stage: deployment
  environment:
    name: paris
    url: https://app.paris.happy-dev.fr
  script:
    - echo "$APP_CONFIG_PARIS" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* paris@ssh-paris.happy-dev.fr:~/sib/www/
  only:
    - master
  when: manual
  tags:
    - deploy

toulouse:
  stage: deployment
  environment:
    name: toulouse
    url: https://smart-toulouse.happy-dev.fr
    - echo "$APP_CONFIG_TOULOUSE" > config.json
    - echo "$SSH_DEPLOY_KEY" | tr -d '\r' > gitlab.key && chmod 600 gitlab.key
    - npm install
    - npm run build
    - scp -i gitlab.key -o StrictHostKeyChecking=no -r dist/* smart-toulouse@ssh-smart-toulouse.happy-dev.fr:~/www/
  only:
    - master
  when: manual
  tags: