Fix SCUM companion trajectory storage
This commit is contained in:
@@ -533,20 +533,39 @@ git init --quiet
|
||||
git remote add origin "$REPOSITORY_URL"
|
||||
git fetch --quiet --depth 1 origin "$SOURCE_REVISION"
|
||||
git checkout --quiet --detach FETCH_HEAD
|
||||
progress 36 'env_check: writing client-manager configuration'
|
||||
{
|
||||
printf 'server_url: "%s"\n' "$PLATFORM_URL"
|
||||
printf 'server_instance_id: "%s"\n' "$SERVER_INSTANCE_ID"
|
||||
printf 'scum_client_credential: "%s"\n' "$auth_key"
|
||||
printf 'scum_client_name: "%s"\n' "$PROFILE_KEY"
|
||||
printf 'scum_client_version: "platform-build"\n'
|
||||
printf 'scum_client_machine_label: "managed-client"\n'
|
||||
printf 'ftp_provider: 3\n'
|
||||
} > config.yaml
|
||||
workspace_ref="${CLIENT_MANAGER_WORKSPACE_REF:-}"
|
||||
entry_ref="${CLIENT_MANAGER_ENTRY_REF:-.}"
|
||||
config_template_ref="${CLIENT_MANAGER_CONFIG_TEMPLATE_REF:-config.yaml.example}"
|
||||
for safe_ref in "$workspace_ref" "$entry_ref" "$config_template_ref"; do
|
||||
case "$safe_ref" in
|
||||
*..*|*://*|/*|*\\*) printf 'client-manager build reference is unsafe\n' >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
build_workdir=/workspace/build
|
||||
if [ -n "$workspace_ref" ]; then
|
||||
build_workdir="/workspace/build/$workspace_ref"
|
||||
fi
|
||||
if [ ! -d "$build_workdir" ]; then
|
||||
printf 'client-manager workspace is missing\n' >&2
|
||||
exit 2
|
||||
fi
|
||||
cd "$build_workdir"
|
||||
if [ ! -f "$config_template_ref" ]; then
|
||||
printf 'client-manager config template is missing\n' >&2
|
||||
exit 2
|
||||
fi
|
||||
progress 36 'env_check: materializing client-manager configuration template'
|
||||
cp "$config_template_ref" config.yaml
|
||||
build_target="$entry_ref"
|
||||
case "$build_target" in
|
||||
''|.) build_target=. ;;
|
||||
./*) ;;
|
||||
*) build_target="./$build_target" ;;
|
||||
esac
|
||||
progress 52 'deps_download: downloading Go modules'
|
||||
go mod download
|
||||
progress 76 'build_compile: compiling client-manager executable'
|
||||
go build -trimpath -ldflags '-s -w' -o "/workspace/output/$OUTPUT_FILENAME" .
|
||||
go build -trimpath -ldflags '-s -w' -o "/workspace/output/$OUTPUT_FILENAME" "$build_target"
|
||||
cp config.yaml /workspace/output/config.yaml
|
||||
progress 88 'package_finalize: client-manager package inputs written'
|
||||
`
|
||||
@@ -582,6 +601,9 @@ func (builder *DockerDistributionBuilder) containerArgs(input domain.Distributio
|
||||
"-e", "PLATFORM_URL=" + platformURL,
|
||||
"-e", "REPOSITORY_URL=" + input.RepositoryURL,
|
||||
"-e", "SOURCE_REVISION=" + input.SourceRevision,
|
||||
"-e", "CLIENT_MANAGER_WORKSPACE_REF=" + input.WorkspaceRef,
|
||||
"-e", "CLIENT_MANAGER_ENTRY_REF=" + input.EntryRef,
|
||||
"-e", "CLIENT_MANAGER_CONFIG_TEMPLATE_REF=" + input.ConfigTemplateRef,
|
||||
"-e", "OUTPUT_FILENAME=" + outputName,
|
||||
builder.config.Image,
|
||||
"/workspace/input/build.sh",
|
||||
|
||||
Reference in New Issue
Block a user