box: ami-7f97d816
box-type: ami
build:
    steps:
        - script:
            name: Go workspace
            code: |
                sudo apt-get update -y -qq
                sudo apt-get install git -y -qq

                wget https://go.googlecode.com/files/go1.1.linux-amd64.tar.gz
                sudo tar -C /usr/local -xzf go1.1.linux-amd64.tar.gz
                export PATH="$PATH:/usr/local/go/bin"
                export PATH="$PATH:$GOPATH/bin"


                export GOPATH="$HOME/go"
                mkdir -p "$GOPATH/{src,bin,pkg}"
                mkdir -p "$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
                rsync -avz "$WERCKER_SOURCE_DIR/" "$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
                export WERCKER_SOURCE_DIR="$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
        - script:
            name: Go environment
            code: go env
        - script:
            name: Go get
            code: go get
        - script:
            name: Go build
            code: go build -o main
        - script:
            name: Copy output
            code: rsync -avz "$WERCKER_SOURCE_DIR/" "$WERCKER_OUTPUT_DIR"
box: ami-7f97d816
box-type: ami
build:
    steps:
        - script:
            name: Go workspace
            code: |
                sudo apt-get update -y -qq
                sudo apt-get install git -y -qq

                wget https://go.googlecode.com/files/go1.1.linux-amd64.tar.gz
                sudo tar -C /usr/local -xzf go1.1.linux-amd64.tar.gz
                export PATH="$PATH:/usr/local/go/bin"
                export PATH="$PATH:$GOPATH/bin"

                export GOPATH="$HOME/go"
                mkdir -p "$GOPATH/{src,bin,pkg}"
                mkdir -p "$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
                rsync -avz "$WERCKER_SOURCE_DIR/" "$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
                export WERCKER_SOURCE_DIR="$GOPATH/src/github.com/pjvds/docker-to-digital-ocean-example"
        - script:
            name: Go environment
            code: go env
        - script:
            name: Go get
            code: go get
        - script:
            name: Go build
            code: go build -o main
        - script:
            name: Build container
            code: docker build -t="pjvds/counter" .
        - script:
            name: Export container
            code: |
                CID=$(docker run -d -entrypoint="/bin/sh" pjvds/counter /bin/echo hello world)
                docker export $CID > $WERCKER_OUTPUT_DIR/counter.tar
Build container during CI build
Build container during CI build
