diff --git a/source/Octopus.Tentacle/Kubernetes/bootstrapRunner.sh b/source/Octopus.Tentacle/Kubernetes/bootstrapRunner.sh index 5c0d15e53..e4ec67ed2 100644 --- a/source/Octopus.Tentacle/Kubernetes/bootstrapRunner.sh +++ b/source/Octopus.Tentacle/Kubernetes/bootstrapRunner.sh @@ -40,7 +40,10 @@ shift exec > >(logStdOut) exec 2> >(logStdErr >&2) -/bin/bash $BOOTSTRAP_SCRIPT "$@" +# Change cwd to the working directory +cd "$WORK_DIR" || return + +/bin/bash "$BOOTSTRAP_SCRIPT" "$@" # Write a message to say the job has completed echo "##octopus[stdout-verbose]" diff --git a/source/Octopus.Tentacle/Scripts/Kubernetes/RunningKubernetesJobScript.cs b/source/Octopus.Tentacle/Scripts/Kubernetes/RunningKubernetesJobScript.cs index 395a0795c..0649b3643 100644 --- a/source/Octopus.Tentacle/Scripts/Kubernetes/RunningKubernetesJobScript.cs +++ b/source/Octopus.Tentacle/Scripts/Kubernetes/RunningKubernetesJobScript.cs @@ -215,9 +215,9 @@ async Task CreateJob(IScriptLogWriter writer, CancellationToken cancellationToke Command = new List { "bash" }, Args = new List { - $"/data/tentacle-home/Work/{scriptTicket.TaskId}/bootstrapRunner.sh", - $"/data/tentacle-home/Work/{scriptTicket.TaskId}", - $"/data/tentacle-home/Work/{scriptTicket.TaskId}/{scriptName}" + $"/octopus/Work/{scriptTicket.TaskId}/bootstrapRunner.sh", + $"/octopus/Work/{scriptTicket.TaskId}", + $"/octopus/Work/{scriptTicket.TaskId}/{scriptName}" }.Concat((workspace.ScriptArguments ?? Array.Empty()) .SelectMany(arg => new[] { @@ -225,12 +225,12 @@ async Task CreateJob(IScriptLogWriter writer, CancellationToken cancellationToke })).ToList(), VolumeMounts = new List { - new("/data/tentacle-home", "tentacle-home"), + new("/octopus", "tentacle-home"), }, Env = new List { - new(EnvironmentVariables.TentacleHome, $"/data/tentacle-home"), - new(EnvironmentVariables.TentacleJournal, $"/data/tentacle-home/DeploymentJournal.xml"), + new(EnvironmentVariables.TentacleHome, $"/octopus"), + new(EnvironmentVariables.TentacleJournal, $"/octopus/DeploymentJournal.xml"), new(EnvironmentVariables.TentacleInstanceName, instanceName), new(EnvironmentVariables.TentacleVersion, Environment.GetEnvironmentVariable(EnvironmentVariables.TentacleVersion)), new(EnvironmentVariables.TentacleCertificateSignatureAlgorithm, Environment.GetEnvironmentVariable(EnvironmentVariables.TentacleCertificateSignatureAlgorithm)),