-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwercker-box.yml
More file actions
72 lines (67 loc) · 2.14 KB
/
wercker-box.yml
File metadata and controls
72 lines (67 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: golang
version: 1.0.1
inherits: wercker/ubuntu12.04-webessentials@0.0.3
type : main
platform : ubuntu@12.04
description : golang
keywords:
- golang
- go
packages :
- golang@1.1.1
- git
- mercurial
- bzr
script : |
sudo apt-get update
sudo apt-get install bzr
sudo apt-get install mercurial
wget https://go.googlecode.com/files/go1.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" | sudo tee -a /etc/profile
rm go1.1.linux-amd64.tar.gz
# Set GOPATH
export GOPATH="$HOME/go"
echo 'export GOPATH="$HOME/go"' | sudo tee -a /etc/profile
# Adds go bin directory to path so tools
# and buils are available on the commandline
export PATH="$PATH:$GOPATH/bin"
echo 'export PATH="$PATH:$GOPATH/bin"' | sudo tee -a /etc/profile
# Make actual go workspace dir structure
mkdir -p "$HOME/go/{src,pkg,bin}"
box-detect:
priority : 900
version :
detect:
- files:
- .godir
default-build:
python:
priority : 50
detect:
- default: true
text-to-append: |
# Build definition
build:
# The steps that will be executed on build
steps:
- script:
name: setup golang
code: |-
if test "${WERCKER_GIT_REPOSITORY+set}" == set; then mkdir -p "$GOPATH/src/$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY"; else ln -s $WERCKER_SOURCE_DIR $GOPATH/src; fi
if test "${WERCKER_GIT_REPOSITORY+set}" == set; then cp -R $WERCKER_SOURCE_DIR/* "$GOPATH/src/$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY"; fi
if test "${WERCKER_GIT_REPOSITORY+set}" == set; then export WERCKER_SOURCE_DIR="$GOPATH/src/$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY"; fi
- script:
name: go get
code: |
cd $WERCKER_SOURCE_DIR
go version
go get ./...
- script:
name: go build
code: |
go build
- script:
name: go test
code: |
go test ./...