Skip to content

Commit eed948f

Browse files
committed
Fixes and preperations for agent 1.0-beta.3
1 parent 5b86595 commit eed948f

File tree

9 files changed

+23
-13
lines changed

9 files changed

+23
-13
lines changed

buildbox/script.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ func InitProcess(scriptPath string, env []string, runInPty bool, callback func(*
4040
var process Process
4141
process.RunInPty = runInPty
4242

43-
// Find the script to run
44-
pathToScript, _ := filepath.Abs(path.Dir(scriptPath))
45-
localScriptName := path.Base(scriptPath)
43+
process.command = exec.Command(scriptPath)
4644

47-
process.command = exec.Command(localScriptName)
45+
// Set the working directory of the process
46+
pathToScript, _ := filepath.Abs(path.Dir(scriptPath))
4847
process.command.Dir = pathToScript
4948

5049
// Children of the forked process will inherit its process group

buildbox/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package buildbox
22

33
const (
4-
Version = "1.0-beta.2"
4+
Version = "1.0-beta.3"
55
)

command/agent_start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func AgentStartCommandAction(c *cli.Context) {
4040
// Create a client so we can register the agent
4141
var client buildbox.Client
4242
client.AuthorizationToken = agentRegistrationToken
43-
client.URL = c.String("url")
43+
client.URL = c.String("endpoint")
4444

4545
agentMetaData := c.StringSlice("meta-data")
4646

@@ -65,7 +65,7 @@ func AgentStartCommandAction(c *cli.Context) {
6565
}
6666

6767
// Start the agent using the token we have
68-
agent := setupAgent(agentAccessToken, bootstrapScript, !c.Bool("no-pty"), c.String("url"))
68+
agent := setupAgent(agentAccessToken, bootstrapScript, !c.Bool("no-pty"), c.String("endpoint"))
6969

7070
// Setup signal monitoring
7171
agent.MonitorSignals()

command/artifact_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func ArtifactDownloadCommandAction(c *cli.Context) {
5252

5353
// Client specific options
5454
agent.Client.AuthorizationToken = agentAccessToken
55-
agent.Client.URL = c.String("url")
55+
agent.Client.URL = c.String("endpoint")
5656

5757
// Setup the agent
5858
agent.Setup()

command/artifact_upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func ArtifactUploadCommandAction(c *cli.Context) {
4343

4444
// Client specific options
4545
agent.Client.AuthorizationToken = agentAccessToken
46-
agent.Client.URL = c.String("url")
46+
agent.Client.URL = c.String("endpoint")
4747

4848
// Setup the agent
4949
agent.Setup()

command/data_get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func DataGetCommandAction(c *cli.Context) {
2828
// Create a client so we can register the agent
2929
var client buildbox.Client
3030
client.AuthorizationToken = agentAccessToken
31-
client.URL = c.String("url")
31+
client.URL = c.String("endpoint")
3232

3333
// Find the job
3434
job, err := client.JobFind(jobId)

command/data_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func DataSetCommandAction(c *cli.Context) {
2828
// Create a client so we can register the agent
2929
var client buildbox.Client
3030
client.AuthorizationToken = agentAccessToken
31-
client.URL = c.String("url")
31+
client.URL = c.String("endpoint")
3232

3333
// Find the job
3434
job, err := client.JobFind(jobId)

install.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ then
1414
exit 1
1515
fi
1616

17+
if [ "$VERSION" = "1.0-beta.2" ]
18+
then
19+
echo "NOTICE: Installing 1.0-beta.2 is no longer supported...sorry. Please install 1.0-beta.3"
20+
exit 1
21+
fi
22+
1723
if [ "$BETA" = "true" ]
1824
then
19-
VERSION="1.0-beta.2"
25+
VERSION="1.0-beta.3"
2026
fi
2127

2228
# Allow custom setting of the version
@@ -97,7 +103,7 @@ tar -C $DESTINATION -zxf $DESTINATION/$DOWNLOAD
97103

98104
INSTALLED_VERSION=`$DESTINATION/buildbox-agent --version`
99105

100-
if [[ "$INSTALLED_VERSION" = "buildbox version 1.0-beta.2" ]]
106+
if [[ "$INSTALLED_VERSION" = "buildbox-agent version 1.0-beta.3" ]]
101107
then
102108
# Move the buildbox binary into a bin folder
103109
mkdir -p $DESTINATION/bin

templates/bootstrap.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ function buildbox-run {
1717

1818
echo '--- setup environment'
1919

20+
if [ "$BUILDBOX_AGENT_DEBUG" == "true" ]
21+
then
22+
buildbox-run "env | grep BUILDBOX"
23+
fi
24+
2025
# This will return the location of this file. We assume that the buildbox-artifact
2126
# tool is in the same folder. You can of course customize the locations
2227
# and edit this file.

0 commit comments

Comments
 (0)