Skip to content

Instantly share code, notes, and snippets.

@leevigraham
Created February 7, 2017 03:54

Revisions

  1. leevigraham revised this gist Feb 7, 2017. No changes.
  2. leevigraham created this gist Feb 7, 2017.
    61 changes: 61 additions & 0 deletions pipeline.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,61 @@
    #!/bin/bash

    set -eu

    echo "steps:"

    echo "
    - label: \":hammer: dev\"
    command: |-
    source .env
    composer install --verbose --prefer-dist --optimize-autoloader --no-progress --no-interaction
    npm install
    ./node_modules/bower/bin/bower install
    mysql -u \$DB_USER -p\$DB_PASSWORD \$DB_NAME < craft/storage/backups/test.sql
    bin/behat
    "

    if [[ "$BUILDKITE_BRANCH" == "master" && "$BUILDKITE_REPO" == *"github.com:newism"* ]]; then

    echo "
    - wait
    - label: \":shipit: dev\"
    command: |-
    bin/dep deploy:feature dev --branch=\$BUILDKITE_BRANCH --revision=\$BUILDKITE_COMMIT -vv
    - block: \":crystal_ball: Preview stage changes\"
    branches: master
    - label: \":thinking_face: :git: diff stage\"
    branches: master
    command: |-
    bin/dep deploy:diff dev --branch=\$BUILDKITE_BRANCH --revision=\$BUILDKITE_COMMIT
    - block: \":rocket: Deploy to stage\"
    branches: master
    - label: \":shipit: stage\"
    branches: master
    command: |-
    bin/dep deploy stage --branch=\$BUILDKITE_BRANCH --revision=\$BUILDKITE_COMMIT -vv
    - block: \":crystal_ball: Preview prod changes\"
    branches: master
    - label: \":thinking_face: :git: diff prod\"
    branches: master
    command: |-
    bin/dep deploy:diff prod --branch=\$BUILDKITE_BRANCH --revision=\$BUILDKITE_COMMIT
    - block: \":rocket: Deploy to prod\"
    branches: master
    - label: \":shipit: prod\"
    branches: master
    command: |-
    bin/dep deploy prod --branch=\$BUILDKITE_BRANCH --revision=\$BUILDKITE_COMMIT -vv
    "

    fi