From 38e28ea53605d1724a6a5a602fdebab3e723bc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Thu, 26 Nov 2020 23:13:22 +0100 Subject: [PATCH] WORKS: .gitlab-ci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .gitlab-ci.yml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc0d6be..e304e93 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,5 @@ stages: - build - - test - deploy build: @@ -8,9 +7,8 @@ build: image: node script: - echo "Start building App" - - npm install typescript eslint - - npm install - - npm run build + - yarn + - CI= yarn run build - echo "Build successfully!" artifacts: expire_in: 1 hour @@ -18,19 +16,19 @@ build: - build - node_modules/ -test: - stage: test - image: node - script: - - echo "Testing App" - - CI=true npm test --passWithNoTests - - echo "Test successfully!" - deploy_production: - stage: deploy - script: - - echo "Deploying to server" - - rsync --progress -r build/* --delete root@35.207.132.68:/var/www/plannaplan.pl - - echo "Deployed" - only: - - master + stage: deploy + before_script: + - apt-get update + - apt-get --yes --force-yes install rsync + script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - 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' + - echo "Deploying to server" + - rsync --progress -r build/* --delete website@wmi-frontend.pl:/var/www/plannaplan.pl + - echo "Deployed" + only: + - master