From a6f323c8eb5c2dcef343fbee0d0cc39150971345 Mon Sep 17 00:00:00 2001 From: Levin Faber Date: Thu, 9 May 2019 16:49:41 +0000 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be3dc02..2f76bfd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,7 @@ build_frontend: stage: build image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build before_script: - - echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key - - chmod 600 /workdir/deploy_key + - ssh-add <(${DEPLOY_ENV_KEY}) - mkdir -p ~/.ssh - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - cp -r Frontend/src/ /workdir/src/ @@ -18,6 +17,6 @@ build_frontend: - cd /workdir - npm run build - ls -la /workdir/build - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "mkdir -p /opt/serve/" - - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "rm -rf /opt/serve/*" - - rsync --progress -av -e "ssh -i /workdir/deploy_key" /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/opt/serve/ + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "mkdir -p /home/$DEPLOY_ENV_USER/serve" + - ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*" + - rsync --progress -av -e ssh /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve