From da70994b75cb3d6065b7143d4e440498a280bed5 Mon Sep 17 00:00:00 2001 From: Matthias Rolke Date: Sat, 14 Jun 2014 13:45:36 +0200 Subject: [PATCH] Fix force option of git/heroku/tsuru deploy plugin The build artifacts were actually not pushed because the HEAD ref before the commit 'add build artifacts' was used in the git push command. --- pkg/plugin/deploy/git.go | 2 +- pkg/plugin/deploy/heroku.go | 2 +- pkg/plugin/deploy/tsuru.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/plugin/deploy/git.go b/pkg/plugin/deploy/git.go index 03df6f08..269d6d16 100644 --- a/pkg/plugin/deploy/git.go +++ b/pkg/plugin/deploy/git.go @@ -35,7 +35,7 @@ func (g *Git) Write(f *buildfile.Buildfile) { // that need to be deployed to git remote. f.WriteCmd(fmt.Sprintf("git add -A")) f.WriteCmd(fmt.Sprintf("git commit -m 'add build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push deploy $COMMIT:%s --force", destinationBranch)) + f.WriteCmd(fmt.Sprintf("git push deploy HEAD:%s --force", destinationBranch)) case false: // otherwise we just do a standard git push f.WriteCmd(fmt.Sprintf("git push deploy $COMMIT:%s", destinationBranch)) diff --git a/pkg/plugin/deploy/heroku.go b/pkg/plugin/deploy/heroku.go index 4e4aa808..a1050eed 100644 --- a/pkg/plugin/deploy/heroku.go +++ b/pkg/plugin/deploy/heroku.go @@ -30,7 +30,7 @@ func (h *Heroku) Write(f *buildfile.Buildfile) { // that need to be deployed to Heroku. f.WriteCmd(fmt.Sprintf("git add -A")) f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master --force")) + f.WriteCmd(fmt.Sprintf("git push heroku HEAD:master --force")) case false: // otherwise we just do a standard git push f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master")) diff --git a/pkg/plugin/deploy/tsuru.go b/pkg/plugin/deploy/tsuru.go index 12f9a3c5..fa87e92e 100644 --- a/pkg/plugin/deploy/tsuru.go +++ b/pkg/plugin/deploy/tsuru.go @@ -30,7 +30,7 @@ func (h *Tsuru) Write(f *buildfile.Buildfile) { // that need to be deployed to Tsuru. f.WriteCmd(fmt.Sprintf("git add -A")) f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push tsuru $COMMIT:master --force")) + f.WriteCmd(fmt.Sprintf("git push tsuru HEAD:master --force")) case false: // otherwise we just do a standard git push f.WriteCmd(fmt.Sprintf("git push tsuru $COMMIT:master"))