Skip to content

Instantly share code, notes, and snippets.

@jkotchoff
Created April 12, 2020 04:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkotchoff/581e0353c15415db1f3dc53a616d6cc6 to your computer and use it in GitHub Desktop.
Save jkotchoff/581e0353c15415db1f3dc53a616d6cc6 to your computer and use it in GitHub Desktop.
Bitrise CI slack workflow
...
workflows:
primary:
steps:
- activate-ssh-key@4.0.3:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@4.0.17: {}
- script@1.1.5:
inputs:
- content: |-
#!/bin/bash
set -e
set -x
envman add --key GITHUB_URL --value "https://github.com/jkotchoff/stocklight/commit/`git log --pretty=format:'%H' -n 1`"
- script@1.1.5:
inputs:
- content: |-
#!/bin/bash
set -e
set -x
if [ $BITRISE_BUILD_STATUS -eq 1 ]
then envman add --key GIPHY_KEYWORDS --value "fail,disappointed,try again"
else envman add --key GIPHY_KEYWORDS --value "success,congrats,victory,such wow,awesome,shipit,yes,panda,cat,hell yeah,applaud,lgtm,surprise,suprise motherfucker,yeah bitches,high five,legendary,lil bub"
fi
- build-status-change@0.1:
inputs:
- access_token: "$BUILD_STATUS_ACCESS_TOKEN"
- verbose: 'yes'
- yarn@0.1.0:
inputs:
- workdir: app
- command: install
- yarn@0.1.0:
inputs:
- workdir: app
- command: test
- giphy@0.1.1:
inputs:
- gif_words: "$GIPHY_KEYWORDS"
- slack@3.1.3:
run_if: '{{enveq "BUILD_STATUS_CHANGED" "true"}}'
inputs:
- is_debug_mode: 'yes'
- webhook_url: https://hooks.slack.com/services/.../.../...
- channel: "#development"
- channel_on_error: "#development"
- author_name: 'Build #$BITRISE_BUILD_NUMBER triggered by $GIT_CLONE_COMMIT_AUTHOR_NAME'
- message: ":white_check_mark: Woot! Build was succesful"
- message_on_error: "\U0001F631 Bugger, Something went wrong"
- fields: []
- buttons: |-
View on Bitrise|${BITRISE_BUILD_URL}
View on GitHub|$GITHUB_URL
- image_url: "$GIF_URL"
- deploy-to-bitrise-io@1.9.2: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment