github.com/jbking/gohan@v0.0.0-20151217002006-b41ccf1c2a96/wercker.yml (about)

     1  box:
     2    id: nati/gohan_builder
     3    entrypoint: /bin/bash -c
     4  
     5  build:
     6    steps:
     7      - script:
     8          name: go env setup
     9          code: |
    10            export GOPATH=/go
    11            export PATH=/go/bin:$PATH
    12            export GOSRC=$GOPATH/src
    13            export REPO_PATH=$GOSRC/github.com/cloudwan
    14            ln -s /pipeline/source $REPO_PATH/gohan
    15      - script:
    16          name: make
    17          code: |
    18            echo $REPO_PATH
    19            cd $REPO_PATH/gohan
    20            make
    21  
    22  deploy:
    23    steps:
    24      - script:
    25          name: build docs
    26          code: |
    27            sudo apt-get update
    28            sudo apt-get install -y python-sphinx python-pip
    29            sudo pip install sphinx_rtd_theme
    30            cd ${WERCKER_SOURCE_DIR}/docs/
    31            make html
    32            touch build/html/.nojekyll
    33      - script:
    34          name: cross compile
    35          code: |
    36            export PATH=/go/bin:$PATH
    37            cd /
    38            TARGETS="linux/amd64 linux/386 darwin/amd64 darwin/386 windows/386" ./build.sh github.com/cloudwan/gohan
    39      - script:
    40          name: zip
    41          code: |
    42            cd /build
    43            mkdir -p ${WERCKER_OUTPUT_DIR}
    44            for binary in $(ls); do
    45                canonical_name=$(echo ${binary} | sed -e 's/-[a-zA-Z0-9-]*//')
    46                cp ${binary} ${canonical_name}
    47                archive_name=$(echo ${binary} | sed -e 's/.exe$//').zip
    48                zip -r ${WERCKER_OUTPUT_DIR}/${archive_name} ${canonical_name}
    49            done
    50      - tcnksm/ghr:
    51          token: $GITHUB_TOKEN
    52          input: ${WERCKER_OUTPUT_DIR}
    53          replace: true
    54      - lukevivier/gh-pages@0.2.1:
    55          token: $GITHUB_TOKEN
    56          domain: cloudwan.github.io
    57          basedir: ${WERCKER_SOURCE_DIR}/docs/build/html
    58      - script:
    59          name: trigger ansible-gohan build
    60          code: |
    61              sudo apt-get install -y curl
    62              curl  -H 'Content-Type: application/json' \
    63                    -H  "Authorization: Bearer ${WERCKER_TOKEN}" \
    64                    -X POST \
    65                    -d '{"applicationId": "'${ANSIBLE_GOHAN_APP_ID}'", "message":"build triggered from gohan repo"}' \
    66                    https://app.wercker.com/api/v3/builds