Skip to content

Commit 802afed

Browse files
committed
terraform install try again
1 parent f1a5337 commit 802afed

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

test/octopus_container_test_framework.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri
200200
Image: o.getOctopusImageUrl() + ":" + o.getOctopusVersion(),
201201
ExposedPorts: []string{"8080/tcp"},
202202
Env: map[string]string{
203-
"ACCEPT_EULA": "Y",
204-
"DB_CONNECTION_STRING": connString,
205-
// CONNSTRING, LICENSE_BASE64, and CREATE_DB are used by the octopusdeploy/linux image
203+
"ACCEPT_EULA": "Y",
204+
"DB_CONNECTION_STRING": connString,
206205
"CONNSTRING": connString,
207206
"CREATE_DB": "Y",
208207
"ADMIN_API_KEY": getApiKey(),
@@ -212,17 +211,26 @@ func (o *OctopusContainerTest) setupOctopus(ctx context.Context, connString stri
212211
"OCTOPUS_SERVER_BASE64_LICENSE": os.Getenv("LICENSE"),
213212
"LICENSE_BASE64": os.Getenv("LICENSE"),
214213
"ENABLE_USAGE": "N",
214+
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
215215
},
216216
Privileged: disableDind != "Y",
217217
WaitingFor: wait.ForLog("Listening for HTTP requests on").WithStartupTimeout(30 * time.Minute),
218218
Networks: []string{
219219
network,
220220
},
221-
Cmd: []string{
222-
"/bin/sh",
221+
// Instead of using Cmd for installation, use an EntryPoint script
222+
Entrypoint: []string{
223+
"/bin/bash",
223224
"-c",
224-
"wget -O - https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/hashicorp.list && apt update -y && apt install terraform -y",
225-
}}
225+
"apt-get update && apt-get install -y curl gnupg lsb-release && " +
226+
"curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && " +
227+
"echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/hashicorp.list > /dev/null && " +
228+
"apt-get update && apt-get install -y terraform && " +
229+
"which terraform && " + // Verify where terraform is installed
230+
"terraform --version && " + // Verify terraform is working
231+
"/usr/local/bin/octopus.server.sh", // Start the Octopus server process
232+
},
233+
}
226234

227235
req.Env = o.AddCustomEnvironment(req.Env)
228236

0 commit comments

Comments
 (0)