Travis CI:需要明确确认才能运行作业

时间:2019-08-05 08:53:29

标签: continuous-integration travis-ci continuous-deployment

我有一个非常简单的Travis CI构建管道,用于测试Python Django应用程序并将其部署到Heroku,如我的.travis.yml文件中所示:

dist: xenial # required for Python >= 3.7
language: python
cache: pip
python:
  - '3.7'
install: make install
jobs:
  include:
    - stage: unit tests
      script: make test
    - stage: deploy to stage
      script: skip
      deploy:
        provider: heroku
        app: my-heroku-app-stage
        api_key:
          secure: $HEROKU_AUTH_TOKEN
    - stage: test stage
      script: 'curl https://endpoint-stage.com'
    - stage: deploy to production
      script: skip
      deploy:
        provider: heroku
        app: my-heroku-app
        api_key:
          secure: $HEROKU_AUTH_TOKEN
    - stage: test production
      script: 'curl https://endpoint.com'
stages:
  - name: unit tests
  - name: deploy to stage
  - name: test stage
  - name: deploy to production
    if: type = push AND branch = master
  - name: test production
    if: type = push AND branch = master

我只希望在确认管道后(通过按下Travis CI网站上的按钮或类似的按钮)将管道部署到生产中。反正我有配置它吗?

0 个答案:

没有答案