stages: - build - deploy .build: stage: build allow_failure: false variables: GIT_STRATEGY: clone script: - mvn clean package .deploy: stage: deploy variables: GIT_STRATEGY: none allow_failure: false when: manual script: - > if [ "$GITLAB_USER_LOGIN" == "manhnv" ]; then sudo su ${runninguser} sh -c "rm -rf $folderdeploy/${appname}*" sleep 3s sudo cp -R $build_releaseTarget $folderdeploy sleep 3s sudo chown -R ${runninguser}. $folderdeploy/${appname}* sleep 3s sudo systemctl restart tomcat else echo "Permission denied" exit 1 fi runner_staging_build: extends: - .build tags: - hv-portal runner_staging_deploy: extends: - .deploy tags: - hv-portal