Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] git push --no-verify #1184

Closed
wavemotionio opened this issue Mar 27, 2019 · 4 comments
Closed

[rush] git push --no-verify #1184

wavemotionio opened this issue Mar 27, 2019 · 4 comments
Labels
enhancement The issue is asking for a new feature or design change

Comments

@wavemotionio
Copy link

wavemotionio commented Mar 27, 2019

We are using rush change -v on the pre-push git hook to make sure that changes are logged prior to a push. Unfortunately, this interrupts publish from working correctly in the azure devops CI pipeline. The solution is to invoke git push --no-verify as demonstrated below. Is there a better way to do this?

Desired code:

- powershell: |
   git config --global user.name "Rushbot"
   git config --global user.email [email protected]
   node common/scripts/install-run-rush.js publish -a -b master --add-commit-details
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'bump updated packages'
  failOnStderr: true
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))

Work around:

- powershell: |
   git config --global user.name "Rushbot"
   git config --global user.email [email protected]
   node common/scripts/install-run-rush.js version --bump
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'bump updated packages'
  failOnStderr: true
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))

- powershell: |
   git checkout -b cirelease
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'git checkout'
  failOnStderr: false
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))

- powershell: |
   git add -A
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'git add'
  failOnStderr: false
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))

- powershell: |
   git reset HEAD file common/config/rush/.npmrc
   git commit -m "ci: version bump [skip ci]"
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'git commit'
  failOnStderr: false
  continueOnError: true
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))

- powershell: |
   git push https://<pat>:[email protected]/project/_git/repo-name cirelease:master --no-verify
  workingDirectory: '$(Build.Repository.LocalPath)'
  displayName: 'git push'
  failOnStderr: false
  continueOnError: true
  condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
@wavemotionio
Copy link
Author

Possible solution: #1187

@wavemotionio wavemotionio changed the title [rush] publish pre-push --no-verify [rush] git push --no-verify Mar 27, 2019
@octogonz octogonz added the enhancement The issue is asking for a new feature or design change label Mar 29, 2019
@octogonz
Copy link
Collaborator

This solution makes sense to me. We don't really want git hooks interfering with the automated CI operations.

It's tempting to enable rush install to disable the Git hooks entirely on a CI machine. But maybe the scalpel is wiser than the battle axe.

@wavemotionio
Copy link
Author

Having an option to disable Git hooks entirely could be useful too but some folks might be using hooks for notifications and such. A more holistic approach might require an option that takes parameters.

@wavemotionio
Copy link
Author

Closed this. Thanks for your help! Please reopen if the process is incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is asking for a new feature or design change
Projects
None yet
Development

No branches or pull requests

2 participants