-
Notifications
You must be signed in to change notification settings - Fork 3
/
commands.txt
7 lines (7 loc) · 1.05 KB
/
commands.txt
1
2
3
4
5
6
7
if command -v sd-cmd >/dev/null 2>&1; then { command_output=$(sd-cmd exec sd/events@latest dns 2>&1); sdcmd_status="$?"; [ "$sdcmd_status" -ne 0 ] && { echo "$command_output" | grep -q 'ERROR: Screwdriver API 404 Not Found: Command sd/events@latest does not exist' || { echo "$command_output" && echo "Something wrong while sending events"; } } || echo "$command_output"; } else echo "no op"; fi
if [ `uname` = 'Darwin' ] || [ ${SD_HAB_ENABLED:-false} = 'false' ]; then export SD_ZIP_CMD_WRAPPER="eval"
export SD_CURL_CMD_WRAPPER="eval"; else export SD_ZIP_CMD_WRAPPER="$(echo 'sd-step exec core/zip')"
export SD_CURL_CMD_WRAPPER="$(echo 'sd-step exec core/curl')"; fi
cd $SD_ARTIFACTS_DIR
find . -type f -print > manifest.txt
if [ "$SD_ZIP_ARTIFACTS" = "true" ]; then ZIPFILE=SD_ARTIFACT.zip && $SD_ZIP_CMD_WRAPPER "zip -r -D $ZIPFILE ./" && store-cli set $ZIPFILE --type=artifact && $SD_CURL_CMD_WRAPPER "curl -X POST -H \"Authorization: Bearer ${SD_TOKEN}\" \"${SD_BUILD_URL}/artifacts/unzip\""; else find . -type f -exec store-cli set $1 --type=artifact -- {} \;; fi;