diff options
| author | Menny Even Danan <menny@evendanan.net> | 2020-02-07 18:30:40 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2020-02-07 20:45:43 +0000 |
| commit | 6edc8f1bb8c1c4308c20f50c039fc9719e70d5ba (patch) | |
| tree | ed272c5945c786c67518643be5e902148813665f /.github/actions | |
| parent | af1d80de6c8fa08b2c596ca309a58e11b7f41c92 (diff) | |
| download | AnySoftKeyboard-6edc8f1bb8c1c4308c20f50c039fc9719e70d5ba.tar.gz AnySoftKeyboard-6edc8f1bb8c1c4308c20f50c039fc9719e70d5ba.tar.bz2 | |
Fix deploy-reports folder
Diffstat (limited to '.github/actions')
| -rwxr-xr-x | .github/actions/deploy-request/request.sh | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/.github/actions/deploy-request/request.sh b/.github/actions/deploy-request/request.sh index 9002fb399..f767be262 100755 --- a/.github/actions/deploy-request/request.sh +++ b/.github/actions/deploy-request/request.sh @@ -3,14 +3,13 @@ set -e REF_TO_DEPLOY="${1}" #we are using exact SHA to deploy, and not branc (which can move) -SHA_TO_DEPLOY="${1}" -API_USERNAME="${2}" -API_TOKEN="${3}" -OUTPUT="${4}" +SHA_TO_DEPLOY="${2}" +API_USERNAME="${3}" +API_TOKEN="${4}" +OUTPUT="${5}" -TEMP_FOLDER="/tmp/${OUTPUT}" -rm -rf "${TEMP_FOLDER}" || true -mkdir -p "${TEMP_FOLDER}" +rm -rf "${OUTPUT}" || true +mkdir -p "${OUTPUT}" function deployment_request() { echo "making request to: ${1}" @@ -21,10 +20,18 @@ function deployment_request() { --arg jsonDescription "${2}" \ '{ ref: $jsonRef, task: "deploy", auto_merge: false, environment: $jsonDeployTarget, description: $jsonDescription, required_contexts: [ "push-ready" ] }' ) - local JSON_FILENAME="${TEMP_FOLDER}/deployment_request_${1}.json" + local JSON_FILENAME="${OUTPUT}/deployment_request_${1}.json" echo "${JSON_TEXT}" > "${JSON_FILENAME}" - - curl -u "${API_USERNAME}:${API_TOKEN}" -o "${TEMP_FOLDER}/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments + cat "${JSON_FILENAME}" + set +e + curl --fail -u "${API_USERNAME}:${API_TOKEN}" -o "${OUTPUT}/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments + local curl_exit_code=$? + set -e + echo "response with exit-code ${curl_exit_code}:" + cat "${OUTPUT}/deployment_response_${1}.json" + if [[ ${curl_exit_code} -ne 0 ]]; then + exit ${curl_exit_code} + fi } #some deploy logic @@ -34,8 +41,3 @@ 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}" |
