Skip to content

Commit

Permalink
feat: add a custom check to run a command (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamstyz4ever authored Oct 2, 2024
1 parent e655431 commit b9aa3ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
if command -v sd-cmd >/dev/null 2>&1; then { sd-cmd exec sd/events@latest dns || echo "Something wrong while sending events" ; } 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
Expand Down
2 changes: 1 addition & 1 deletion test/data/commands.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
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;
if command -v sd-cmd >/dev/null 2>&1; then { sd-cmd exec sd/events@latest dns || echo "Something wrong while sending events" ; } 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;

0 comments on commit b9aa3ca

Please sign in to comment.