Skip to content

fix(deploy): fix git ref verify - #175

Merged
Unitech merged 1 commit into
Unitech:masterfrom
laoshu133:master
Apr 13, 2020
Merged

fix(deploy): fix git ref verify#175
Unitech merged 1 commit into
Unitech:masterfrom
laoshu133:master

Conversation

@laoshu133

Copy link
Copy Markdown
Contributor

This problem is encountered when deploying with pm2 deploy ref ref_hash.

git rev-parse --quiet --verify ${ref_hash} does not check if ref_hash really exists, it only checks if the format is valid.

For example, the command can be executed under the current repo:

# true ref
git rev-parse --quiet --verify 4e9655c042fa43ea82506cf5f4fad583a880568d

# fake ref
git rev-parse --quiet --verify 4e9655c042fa43ea82506cf5f4fad583a8805680

@mkornatz

mkornatz commented Nov 1, 2019

Copy link
Copy Markdown

+1. Just ran into this same issue. It looks like a branch can be supplied as the next param, but the documentation doesn't say anything about that. It'd be great to see this fix applied, or the docs updated with the proper way to specify a ref hash.

In order to work around this, we ended up adding a pre-deploy hook which runs a git fetch --all in order to be able to refer to the ref hash passed in the deploy command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants