Skip to content

Instantly share code, notes, and snippets.

@collin
Last active December 28, 2015 04:08
Show Gist options
  • Save collin/7439713 to your computer and use it in GitHub Desktop.
Save collin/7439713 to your computer and use it in GitHub Desktop.
All this assumes the wercker scripts execute in a directory that contains a divshot.json file and the static files for your app. Would be necessary to copy the token from ~/.divshot/config/user.json
box: wercker/nodejs
# Build definition
build:
# The steps that will be executed on build
steps:
# A step that executes `npm install` command
- npm-install
# A step that executes `npm test` command
- npm-test
# A custom script step, name value is used in the UI
# and the code value contains the command that get executed
- script:
name: deploy to divshot.io staging
code: |
npm install -g divshot-cli && divshot push staging --token <token from ~/.divshot/config/user.json>
@flenter
Copy link

flenter commented Nov 13, 2013

Looks good, I think it is good to move this into a deploy. That way you can more easily rollback deploys and deploy builds to different targets.

# Add this to your wercker.yml below your builds and build steps
deploy:

  # The steps that will be executed on build
  steps:
    - script:
        name: deploy to divshot.io staging
        code: |
          npm install -g divshot-cli 
          divshot push $WERCKER_DEPLOYTARGET_NAME --token $DIVSHOT_TOKEN

In this example the deploy target name is used as the target name for divshot. It also assumes you have created an environment variable named DIVSHOT_TOKEN with your api token.

@collin
Copy link
Author

collin commented Dec 20, 2013

Hey guys, thanks :D I've taken this and added it as a guide in our documentation.

http://docs.divshot.io/integrations/wercker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment