box: node:argon

services:
    - redis:3.0

build:
    steps:
        - script:
                name: server
                code: |
                    cd server
                    npm install
                    npm run lint
                    npm test

        - script:
                name: client
                code: |
                    cd client
                    npm install
                    npm run bower
                    npm run build

        - script:
                name: echo nodejs information
                code: |
                    echo "node version $(node -v) running"
                    echo "npm version $(npm -v) running"

    after-steps:
        - turistforeningen/slack-notifier:
                url: $SLACK_WEBHOOK_URL

deploy:
    steps:
        - add-ssh-key:
                keyname: SSH_KEY
                host: $SSH_HOST

        - wercker/add-to-known_hosts@1.4.0:
                hostname: $SSH_HOST

        - script:
                name: start application
                code: >
                    ssh -l ${SSH_USER} ${SSH_HOST}
                    COMPOSE_FILE=docker-paas.yml
                    /var/www/config/manage.sh ${SSH_APP} update --rebuild

    after-steps:
        - turistforeningen/slack-notifier:
                url: $SLACK_WEBHOOK_URL

box: node:argon

services:
    - redis:3.0

build:
    steps:
        - script:
                name: server
                code: |
                    cd server
                    npm install
                    npm run lint
                    npm test

        - script:
                name: client
                code: |
                    cd client
                    npm install
                    npm run bower
                    npm run build

        - script:
                name: echo nodejs information
                code: |
                    echo "node version $(node -v) running"
                    echo "npm version $(npm -v) running"

    after-steps:
        - turistforeningen/slack-notifier:
                url: $SLACK_WEBHOOK_URL

deploy:
    steps:
        - script:
            name: docker hub build
            code: |
                curl --verbose \
                    -H "Content-Type: application/json" \
                    -d "{\"source_type\": \"Branch\", \"source_name\": \"$DOCKER_TRIGGER_BRANCH\"}" \
                    -X POST $DOCKER_TRIGGER_URL

    after-steps:
        - turistforeningen/slack-notifier:
                url: $SLACK_WEBHOOK_URL

Add Wercker build to Docker Hub
Add Wercker build to Docker Hub
