diff options
| author | Menny Even Danan <menny@evendanan.net> | 2020-02-06 22:02:00 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2020-02-06 22:02:00 +0000 |
| commit | 617623ab19f18e5d69fee4287b92500e15be459e (patch) | |
| tree | dc9a622a60a95444e17691c1c58a5f4c97d4408c /.github/actions/deploy-request/request.sh | |
| parent | fd4b6d70af28e628c4f439c32b4f6212f64a03df (diff) | |
| download | AnySoftKeyboard-617623ab19f18e5d69fee4287b92500e15be459e.tar.gz AnySoftKeyboard-617623ab19f18e5d69fee4287b92500e15be459e.tar.bz2 | |
Ensuring reports are copied back out of the container
Diffstat (limited to '.github/actions/deploy-request/request.sh')
| -rwxr-xr-x | .github/actions/deploy-request/request.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/.github/actions/deploy-request/request.sh b/.github/actions/deploy-request/request.sh index 7dc569005..e784ef7b3 100755 --- a/.github/actions/deploy-request/request.sh +++ b/.github/actions/deploy-request/request.sh @@ -4,8 +4,11 @@ set -e REF_TO_DEPLOY="${1}" API_USERNAME="${2}" API_TOKEN="${3}" +OUTPUT="${4}" -mkdir -p /tmp/deploy-request || true +TEMP_FOLDER="/tmp/${OUTPUT}" +rm -rf "${TEMP_FOLDER}" || true +mkdir -p "${TEMP_FOLDER}" function deployment_request() { echo "making request to: ${1}" @@ -16,10 +19,10 @@ function deployment_request() { --arg jsonDescription "${2}" \ '{ ref: $jsonRef, task: "deploy", auto_merge: false, environment: $jsonDeployTarget, description: $jsonDescription }' ) - local JSON_FILENAME="/tmp/deploy-request/deployment_request_${1}.json" + local JSON_FILENAME="${TEMP_FOLDER}/deployment_request_${1}.json" echo "${JSON_TEXT}" > "${JSON_FILENAME}" - curl -u "${API_USERNAME}:${API_TOKEN}" -o "/tmp/deploy-request/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments + curl -u "${API_USERNAME}:${API_TOKEN}" -o "${TEMP_FOLDER}/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments } #some deploy logic @@ -29,3 +32,8 @@ if [[ "${REF_TO_DEPLOY}" == "refs/heads/master" ]]; then elif [[ "${REF_TO_DEPLOY}" == "release-branch-v"* ]]; then deployment_request "app_beta" "Deployment request by ${API_USERNAME}" fi + +rm -rf "${OUTPUT}" || true +mkdir -p "${OUTPUT}" + +mv "${TEMP_FOLDER}" "${OUTPUT}" |
