Skip to content

Commit db51c97

Browse files
committed
Passing version to executed file
1 parent e0944e7 commit db51c97

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Sleep duration: 30s
6767
2017/08/24 13:33:25 Gist https://gist.github.com/...
6868
2017/08/24 13:33:25 Deployment status create pending
6969
2017/08/24 13:33:26 Executing File bin/deploy-stub
70+
-----> Deploying version: v49.3...
7071
-----> Adding BUILD_ENV to build environment...
7172
-----> Compiling Ruby/Rails
7273
=====> Application deployed:

bin/deploy-stub

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3+
VERSION=$1
34

5+
echo $'remote: \e[1G-----> Deploying version: '$VERSION'...'
46
echo $'remote: \e[1G-----> Adding BUILD_ENV to build environment...'
57
echo $'remote: \e[1G-----> Compiling Ruby/Rails'
68
sleep 2

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func main() {
6868
createDeploymentStatus(ctx, client, deployment, *org, *repo, "pending", *gist.HTMLURL)
6969

7070
var output bytes.Buffer
71-
cmd := executeFile(*file)
71+
cmd := executeFile(*file, *deployment.Ref)
7272
cmd.Stdout = io.MultiWriter(&output, os.Stdout)
7373
cmd.Stderr = cmd.Stdout
7474
err = cmd.Run()
@@ -92,10 +92,10 @@ func sleep(duration time.Duration) {
9292
time.Sleep(duration)
9393
}
9494

95-
func executeFile(filePath string) *exec.Cmd {
95+
func executeFile(filePath string, ref string) *exec.Cmd {
9696
log.Println("Executing File", filePath)
97-
cmd := exec.Command(filePath)
98-
// cmd := exec.Command("bin/deploy-stub")
97+
cmd := exec.Command(filePath, ref)
98+
// cmd := exec.Command("bin/deploy-stub", ref)
9999
return cmd
100100
}
101101

0 commit comments

Comments
 (0)