How do I target a specific commit SHA with capistrano deploy

前端 未结 4 545
南旧
南旧 2021-01-30 07:11

I am wondering how I can target a specific commit SHA in Git for deployment, using Capistrano? It should be something like

cap deploy --version=

        
4条回答
  •  孤街浪徒
    2021-01-30 07:52

    Capistrano 3

    In your deploy.rb or stage-specific file like config/deploy/production.rb

    set :branch, ENV.fetch('REVISION', 'master')
    

    This allows you to point to a specific git revision. It accepts a SHA but also anything that resolves to a real revision (e.g. git tag, annotated tag, or branch).

    Use it on the command line by setting the REVISION environment variable, e.g.

    bundle exec cap production deploy REVISION=80655da8d80aaaf92ce5357e7828dc09adb00993
    
    bundle exec cap staging deploy REVISION=my-topic-branch
    

提交回复
热议问题