image: node:latest stages: - prepare - build - test - deploy cache: paths: - node_modules/ include: - template: SAST.gitlab-ci.yml - template: Code-Quality.gitlab-ci.yml variables: SAST_DISABLE_DIND: "true" prepare: stage: prepare script: - npm install --progress=false build: stage: build script: - npm run build artifacts: expire_in: 7 days paths: - build/ needs: ["prepare"] test: stage: test script: - CI=true npm run test artifacts: reports: junit: - ./junit.xml needs: ["prepare"] coverage: stage: test script: - CI=true npm run coverage artifacts: reports: cobertura: - ./coverage/cobertura-coverage.xml needs: ["prepare"] deploy_test1: stage: deploy image: luki42/alpineopenssh:latest needs: - test - build only: - master script: - eval $(ssh-agent -s) - ssh-add <(echo "$SSH_PRIVATE_KEY") - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - ssh root@192.168.0.42 "cd /var/www/html/ && git fetch origin && git rebase origin/master && exit"