box: golang:1.4
build:
    steps:
        - setup-go-workspace

        - script:
            name: go get
            code: go get ./...

        - script:
            name: go build
            code: go build

        - script:
            name: go test
            code: go test

deploy:
    steps:
        - add-to-known_hosts:
            hostname: blau.io

        - mktemp:
            envvar: PRIVATEKEY_PATH

        - create-file:
            name: write keyfile
            filename: $PRIVATEKEY_PATH
            content: $SSH_PRIVATE
            overwrite: true
            hide-from-log: true

        - script:
            name: install goaci
            code: go get github.com/appc/goaci

        - script:
            name: create ACI
            code: goaci go github.com/blau-io/proxii

        - create-file:
            name: create service file
            filename: proxii.service
            content: $SERVICE
            hide-from-log: true

        - script:
            name: transfer files
            code: scp -i $PRIVATEKEY_PATH proxii.service proxii.aci core@blau.io:~/

        - script:
            name: start new version
            code: |
                ssh -i $PRIVATEKEY_PATH core@blau.io <<
                    fleetctl stop proxii.service
                    fleetctl destroy proxii.service
                    fleetctl start proxii.service
                EOF


box: golang:1.4
build:
    steps:
        - setup-go-workspace

        - script:
            name: go get
            code: go get ./...

        - script:
            name: go build
            code: go build

        - script:
            name: go test
            code: go test

deploy:
    steps:
        - add-to-known_hosts:
            hostname: blau.io

        - mktemp:
            envvar: PRIVATEKEY_PATH

        - create-file:
            name: write keyfile
            filename: $PRIVATEKEY_PATH
            content: $SSH_PRIVATE
            overwrite: true
            hide-from-log: true

        - script:
            name: install goaci
            code: go get github.com/appc/goaci

        - script:
            name: create ACI
            code: goaci go github.com/blau-io/proxii

        - create-file:
            name: create service file
            filename: proxii.service
            content: $SERVICE
            hide-from-log: true

        - script:
            name: transfer files
            code: scp -i $PRIVATEKEY_PATH proxii.service proxii.aci core@blau.io:~/

        - script:
            name: start new version
            code: |
                ssh -i $PRIVATEKEY_PATH core@blau.io '
                    fleetctl stop proxii.service;
                    fleetctl destroy proxii.service;
                    fleetctl start proxii.service;
                '


Update syntax for deploying... again
Update syntax for deploying... again
