diff --git a/agent/job_runner.go b/agent/job_runner.go index c08c8054ea..710baeb45c 100644 --- a/agent/job_runner.go +++ b/agent/job_runner.go @@ -12,9 +12,9 @@ import ( "time" "github.com/buildkite/agent/v3/api" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/experiments" "github.com/buildkite/agent/v3/hook" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/kubernetes" "github.com/buildkite/agent/v3/logger" "github.com/buildkite/agent/v3/metrics" diff --git a/clicommand/agent_start.go b/clicommand/agent_start.go index 71752609f7..22ac2b882b 100644 --- a/clicommand/agent_start.go +++ b/clicommand/agent_start.go @@ -18,11 +18,11 @@ import ( "github.com/buildkite/agent/v3/agent" "github.com/buildkite/agent/v3/api" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/cliconfig" "github.com/buildkite/agent/v3/experiments" "github.com/buildkite/agent/v3/hook" "github.com/buildkite/agent/v3/internal/agentapi" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/utils" "github.com/buildkite/agent/v3/logger" "github.com/buildkite/agent/v3/metrics" diff --git a/clicommand/bootstrap.go b/clicommand/bootstrap.go index dd60cb6b4a..156bd1cf82 100644 --- a/clicommand/bootstrap.go +++ b/clicommand/bootstrap.go @@ -9,9 +9,9 @@ import ( "sync" "syscall" - "github.com/buildkite/agent/v3/bootstrap" "github.com/buildkite/agent/v3/cliconfig" "github.com/buildkite/agent/v3/experiments" + "github.com/buildkite/agent/v3/internal/job" "github.com/buildkite/agent/v3/process" "github.com/urfave/cli" ) @@ -411,7 +411,7 @@ var BootstrapCommand = cli.Command{ } // Configure the bootstraper - bootstrap := bootstrap.New(bootstrap.Config{ + bootstrap := job.New(job.Config{ AgentName: cfg.AgentName, ArtifactUploadDestination: cfg.ArtifactUploadDestination, AutomaticArtifactUploadPaths: cfg.AutomaticArtifactUploadPaths, diff --git a/clicommand/pipeline_upload.go b/clicommand/pipeline_upload.go index 5c9db6007b..5d888cf2e5 100644 --- a/clicommand/pipeline_upload.go +++ b/clicommand/pipeline_upload.go @@ -13,9 +13,9 @@ import ( "github.com/buildkite/agent/v3/agent" "github.com/buildkite/agent/v3/api" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/cliconfig" "github.com/buildkite/agent/v3/env" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/pipeline" "github.com/buildkite/agent/v3/internal/redactor" "github.com/buildkite/agent/v3/internal/stdin" diff --git a/hook/hook.go b/hook/hook.go index 7f13fd2bd0..15c4a051e7 100644 --- a/hook/hook.go +++ b/hook/hook.go @@ -9,7 +9,7 @@ import ( "path/filepath" "runtime" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/utils" ) diff --git a/hook/scriptwrapper.go b/hook/scriptwrapper.go index b5a28fe769..804a7a122e 100644 --- a/hook/scriptwrapper.go +++ b/hook/scriptwrapper.go @@ -10,8 +10,8 @@ import ( "strings" "text/template" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/env" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/shellscript" "github.com/buildkite/agent/v3/internal/utils" ) diff --git a/hook/scriptwrapper_test.go b/hook/scriptwrapper_test.go index 7550222480..11b593254f 100644 --- a/hook/scriptwrapper_test.go +++ b/hook/scriptwrapper_test.go @@ -11,8 +11,8 @@ import ( "strings" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/env" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/bintest/v3" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/bootstrap/api.go b/internal/job/api.go similarity index 98% rename from bootstrap/api.go rename to internal/job/api.go index ccc393d582..c93c86c8be 100644 --- a/bootstrap/api.go +++ b/internal/job/api.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "fmt" diff --git a/bootstrap/bootstrap.go b/internal/job/bootstrap.go similarity index 99% rename from bootstrap/bootstrap.go rename to internal/job/bootstrap.go index 41a89f0d13..7366b2d96b 100644 --- a/bootstrap/bootstrap.go +++ b/internal/job/bootstrap.go @@ -1,8 +1,8 @@ -// Package bootstrap provides management of the phases of execution of a +// package job provides management of the phases of execution of a // Buildkite job. // // It is intended for internal use by buildkite-agent only. -package bootstrap +package job import ( "context" @@ -19,10 +19,10 @@ import ( "time" "github.com/buildkite/agent/v3/agent/plugin" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/env" "github.com/buildkite/agent/v3/experiments" "github.com/buildkite/agent/v3/hook" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/redactor" "github.com/buildkite/agent/v3/internal/shellscript" "github.com/buildkite/agent/v3/internal/utils" diff --git a/bootstrap/bootstrap_test.go b/internal/job/bootstrap_test.go similarity index 97% rename from bootstrap/bootstrap_test.go rename to internal/job/bootstrap_test.go index b254913e4d..a4ef7d7088 100644 --- a/bootstrap/bootstrap_test.go +++ b/internal/job/bootstrap_test.go @@ -1,10 +1,10 @@ -package bootstrap +package job import ( "context" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/redactor" "github.com/buildkite/agent/v3/tracetools" "github.com/google/go-cmp/cmp" diff --git a/bootstrap/config.go b/internal/job/config.go similarity index 99% rename from bootstrap/config.go rename to internal/job/config.go index 95352028fc..7b0e1d8718 100644 --- a/bootstrap/config.go +++ b/internal/job/config.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "reflect" diff --git a/bootstrap/config_test.go b/internal/job/config_test.go similarity index 99% rename from bootstrap/config_test.go rename to internal/job/config_test.go index 9247a4aac1..31f13ad45d 100644 --- a/bootstrap/config_test.go +++ b/internal/job/config_test.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "testing" diff --git a/bootstrap/docker.go b/internal/job/docker.go similarity index 98% rename from bootstrap/docker.go rename to internal/job/docker.go index ff50e1e166..2775a6227e 100644 --- a/bootstrap/docker.go +++ b/internal/job/docker.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" ) var dockerEnv = []string{ diff --git a/bootstrap/git.go b/internal/job/git.go similarity index 99% rename from bootstrap/git.go rename to internal/job/git.go index 7bab2059a2..83a9d24d18 100644 --- a/bootstrap/git.go +++ b/internal/job/git.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "bufio" @@ -12,7 +12,7 @@ import ( "regexp" "strings" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/shellwords" ) diff --git a/bootstrap/git_test.go b/internal/job/git_test.go similarity index 99% rename from bootstrap/git_test.go rename to internal/job/git_test.go index f862df09b5..d14034ae9d 100644 --- a/bootstrap/git_test.go +++ b/internal/job/git_test.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/bootstrap/integration/artifact_integration_test.go b/internal/job/integration/artifact_integration_test.go similarity index 100% rename from bootstrap/integration/artifact_integration_test.go rename to internal/job/integration/artifact_integration_test.go diff --git a/bootstrap/integration/bootstrap_tester.go b/internal/job/integration/bootstrap_tester.go similarity index 100% rename from bootstrap/integration/bootstrap_tester.go rename to internal/job/integration/bootstrap_tester.go diff --git a/bootstrap/integration/checkout_git_mirrors_integration_test.go b/internal/job/integration/checkout_git_mirrors_integration_test.go similarity index 100% rename from bootstrap/integration/checkout_git_mirrors_integration_test.go rename to internal/job/integration/checkout_git_mirrors_integration_test.go diff --git a/bootstrap/integration/checkout_integration_test.go b/internal/job/integration/checkout_integration_test.go similarity index 100% rename from bootstrap/integration/checkout_integration_test.go rename to internal/job/integration/checkout_integration_test.go diff --git a/bootstrap/integration/command_integration_test.go b/internal/job/integration/command_integration_test.go similarity index 100% rename from bootstrap/integration/command_integration_test.go rename to internal/job/integration/command_integration_test.go diff --git a/bootstrap/integration/doc.go b/internal/job/integration/doc.go similarity index 100% rename from bootstrap/integration/doc.go rename to internal/job/integration/doc.go diff --git a/bootstrap/integration/docker_integration_test.go b/internal/job/integration/docker_integration_test.go similarity index 100% rename from bootstrap/integration/docker_integration_test.go rename to internal/job/integration/docker_integration_test.go diff --git a/bootstrap/integration/git.go b/internal/job/integration/git.go similarity index 100% rename from bootstrap/integration/git.go rename to internal/job/integration/git.go diff --git a/bootstrap/integration/hooks_integration_test.go b/internal/job/integration/hooks_integration_test.go similarity index 99% rename from bootstrap/integration/hooks_integration_test.go rename to internal/job/integration/hooks_integration_test.go index eba98596fa..45afcad5bf 100644 --- a/bootstrap/integration/hooks_integration_test.go +++ b/internal/job/integration/hooks_integration_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/experiments" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/bintest/v3" ) diff --git a/bootstrap/integration/job_api_integration_test.go b/internal/job/integration/job_api_integration_test.go similarity index 100% rename from bootstrap/integration/job_api_integration_test.go rename to internal/job/integration/job_api_integration_test.go diff --git a/bootstrap/integration/main_test.go b/internal/job/integration/main_test.go similarity index 100% rename from bootstrap/integration/main_test.go rename to internal/job/integration/main_test.go diff --git a/bootstrap/integration/plugin_integration_test.go b/internal/job/integration/plugin_integration_test.go similarity index 99% rename from bootstrap/integration/plugin_integration_test.go rename to internal/job/integration/plugin_integration_test.go index 6c1e97c1f5..5f62b31f4e 100644 --- a/bootstrap/integration/plugin_integration_test.go +++ b/internal/job/integration/plugin_integration_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/bintest/v3" ) diff --git a/bootstrap/integration/test-binary-hook/main.go b/internal/job/integration/test-binary-hook/main.go similarity index 100% rename from bootstrap/integration/test-binary-hook/main.go rename to internal/job/integration/test-binary-hook/main.go diff --git a/bootstrap/knownhosts.go b/internal/job/knownhosts.go similarity index 98% rename from bootstrap/knownhosts.go rename to internal/job/knownhosts.go index 4455c0df75..a8ab7c32ae 100644 --- a/bootstrap/knownhosts.go +++ b/internal/job/knownhosts.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "bufio" @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" homedir "github.com/mitchellh/go-homedir" "golang.org/x/crypto/ssh/knownhosts" ) diff --git a/bootstrap/knownhosts_test.go b/internal/job/knownhosts_test.go similarity index 96% rename from bootstrap/knownhosts_test.go rename to internal/job/knownhosts_test.go index e1417351b5..051855e5dc 100644 --- a/bootstrap/knownhosts_test.go +++ b/internal/job/knownhosts_test.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/gliderlabs/ssh" ) diff --git a/bootstrap/shell/batch.go b/internal/job/shell/batch.go similarity index 100% rename from bootstrap/shell/batch.go rename to internal/job/shell/batch.go diff --git a/bootstrap/shell/export_test.go b/internal/job/shell/export_test.go similarity index 100% rename from bootstrap/shell/export_test.go rename to internal/job/shell/export_test.go diff --git a/bootstrap/shell/logger.go b/internal/job/shell/logger.go similarity index 100% rename from bootstrap/shell/logger.go rename to internal/job/shell/logger.go diff --git a/bootstrap/shell/logger_test.go b/internal/job/shell/logger_test.go similarity index 97% rename from bootstrap/shell/logger_test.go rename to internal/job/shell/logger_test.go index f87ed1c719..b6758c939b 100644 --- a/bootstrap/shell/logger_test.go +++ b/internal/job/shell/logger_test.go @@ -6,7 +6,7 @@ import ( "runtime" "testing" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/google/go-cmp/cmp" ) diff --git a/bootstrap/shell/lookpath.go b/internal/job/shell/lookpath.go similarity index 100% rename from bootstrap/shell/lookpath.go rename to internal/job/shell/lookpath.go diff --git a/bootstrap/shell/lookpath_windows.go b/internal/job/shell/lookpath_windows.go similarity index 100% rename from bootstrap/shell/lookpath_windows.go rename to internal/job/shell/lookpath_windows.go diff --git a/bootstrap/shell/shell.go b/internal/job/shell/shell.go similarity index 100% rename from bootstrap/shell/shell.go rename to internal/job/shell/shell.go diff --git a/bootstrap/shell/shell_test.go b/internal/job/shell/shell_test.go similarity index 99% rename from bootstrap/shell/shell_test.go rename to internal/job/shell/shell_test.go index a5e35a3a60..38f3ae3114 100644 --- a/bootstrap/shell/shell_test.go +++ b/internal/job/shell/shell_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/bintest/v3" "github.com/google/go-cmp/cmp" ) diff --git a/bootstrap/shell/signal.go b/internal/job/shell/signal.go similarity index 100% rename from bootstrap/shell/signal.go rename to internal/job/shell/signal.go diff --git a/bootstrap/shell/signal_windows.go b/internal/job/shell/signal_windows.go similarity index 100% rename from bootstrap/shell/signal_windows.go rename to internal/job/shell/signal_windows.go diff --git a/bootstrap/shell/tempfile.go b/internal/job/shell/tempfile.go similarity index 100% rename from bootstrap/shell/tempfile.go rename to internal/job/shell/tempfile.go diff --git a/bootstrap/shell/test.go b/internal/job/shell/test.go similarity index 100% rename from bootstrap/shell/test.go rename to internal/job/shell/test.go diff --git a/bootstrap/ssh.go b/internal/job/ssh.go similarity index 97% rename from bootstrap/ssh.go rename to internal/job/ssh.go index 847cb09bbf..8e8ebcd795 100644 --- a/bootstrap/ssh.go +++ b/internal/job/ssh.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/roko" ) diff --git a/bootstrap/ssh_test.go b/internal/job/ssh_test.go similarity index 97% rename from bootstrap/ssh_test.go rename to internal/job/ssh_test.go index 705db89b83..0c539a5c16 100644 --- a/bootstrap/ssh_test.go +++ b/internal/job/ssh_test.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/bintest/v3" "github.com/stretchr/testify/assert" ) diff --git a/bootstrap/tracing.go b/internal/job/tracing.go similarity index 99% rename from bootstrap/tracing.go rename to internal/job/tracing.go index 732abc0a72..3030b244d2 100644 --- a/bootstrap/tracing.go +++ b/internal/job/tracing.go @@ -1,4 +1,4 @@ -package bootstrap +package job import ( "context" diff --git a/internal/redactor/redactor.go b/internal/redactor/redactor.go index 7ff879cdfa..d4a65902f0 100644 --- a/internal/redactor/redactor.go +++ b/internal/redactor/redactor.go @@ -7,7 +7,7 @@ import ( "path" "sync" - "github.com/buildkite/agent/v3/bootstrap/shell" + "github.com/buildkite/agent/v3/internal/job/shell" ) // RedactLengthMin is the shortest string length that will be considered a diff --git a/jobapi/server.go b/jobapi/server.go index d10a81caec..2e22d3a162 100644 --- a/jobapi/server.go +++ b/jobapi/server.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/env" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/internal/socket" ) diff --git a/jobapi/server_test.go b/jobapi/server_test.go index 49f1fc5ad1..e93753bff3 100644 --- a/jobapi/server_test.go +++ b/jobapi/server_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/buildkite/agent/v3/bootstrap/shell" "github.com/buildkite/agent/v3/env" + "github.com/buildkite/agent/v3/internal/job/shell" "github.com/buildkite/agent/v3/jobapi" "github.com/google/go-cmp/cmp" )