我有自己的gilab服务器和gitlab运行程序(独立的VM)。
我的配置是:
image: miroff/php7.4-tests:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
stages:
- build
- deploy
build:
stage: build
script:
- php init --env=Production --overwrite=y
- composer install -o --no-interaction --no-ansi --prefer-dist
deploy_production:
image: ubuntu:18.04
stage: deploy
before_script:
- apt-get update
- apt-get install -qq git
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- 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'
environment:
name: production
script:
- ssh proj@*.*.* "cd /var/www/proj && git checkout master && git pull origin master && $(which php) /var/www/proj/init --env=Production --overwrite=y && $(which php) /var/www/proj/yii migrate --interactive=0 && exit"
only:
- master
我在构建或部署工作上失败(随机)
但是!如果我按下按钮“重试”,它将起到一种魅力。
有什么建议吗?