From d359a205e1d8794e7cc7c8ddb8fda44e95d73e74 Mon Sep 17 00:00:00 2001 From: Walt Della Date: Wed, 12 Oct 2022 08:49:27 -0700 Subject: [PATCH] Fix yum repo cleanup Previously, "${ARTIFACT_PATH}" was interpreted as Drone variable subsitution, resulting in "rm -rf ${ARTIFACT_PATH}/*" becoming "rm -rf /*", which deleted credentials on the filesystem. --- .drone.yml | 6 +++--- dronegen/os_repos.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index e307f94cba111..d133f7eb40c6e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7565,7 +7565,7 @@ steps: image: amazon/aws-cli commands: - mkdir -pv "$ARTIFACT_PATH" - - rm -rf "${ARTIFACT_PATH}/*" + - rm -rf "$ARTIFACT_PATH/*" - aws s3 sync --no-progress --delete --exclude "*" --include "*.deb*" s3://$AWS_S3_BUCKET/teleport/tag/${DRONE_TAG##v}/ "$ARTIFACT_PATH" environment: @@ -7762,7 +7762,7 @@ steps: image: amazon/aws-cli commands: - mkdir -pv "$ARTIFACT_PATH" - - rm -rf "${ARTIFACT_PATH}/*" + - rm -rf "$ARTIFACT_PATH/*" - aws s3 sync --no-progress --delete --exclude "*" --include "*.rpm*" s3://$AWS_S3_BUCKET/teleport/tag/${DRONE_TAG##v}/ "$ARTIFACT_PATH" environment: @@ -8966,6 +8966,6 @@ steps: WORKSPACE_DIR: /tmp/build-darwin-amd64-connect --- kind: signature -hmac: 77b06908f82db11aa8658a71650f0b5f2c4ea5f80788c841c38582a09e894321 +hmac: c920a0310bbda97402bd2c855ea9d8b21a5b36725ed30df7c4351f2dff0d8e55 ... diff --git a/dronegen/os_repos.go b/dronegen/os_repos.go index 82f08f20e89cd..3f798527d847b 100644 --- a/dronegen/os_repos.go +++ b/dronegen/os_repos.go @@ -391,7 +391,7 @@ func (optpb *OsPackageToolPipelineBuilder) getVersionSteps(codePath, version str Commands: []string{ "mkdir -pv \"$ARTIFACT_PATH\"", // Clear out old versions from previous steps - "rm -rf \"${ARTIFACT_PATH}/*\"", + "rm -rf \"$ARTIFACT_PATH/*\"", strings.Join( []string{ "aws s3 sync",