Skip to content

Commit fe82a01

Browse files
committed
travis build configuration with custom go get path
1 parent b6ffcb5 commit fe82a01

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ go:
1313
- tip
1414

1515
before_install:
16-
- go get github.com/onsi/gomega
17-
- go get github.com/onsi/ginkgo
18-
- go get golang.org/x/tools/cmd/cover
16+
- bash prepare-aah-env.sh "forge essentials config test" "log"
1917

2018
install:
21-
- go get -v -t ./...
19+
- go get -v -t aahframework.org/log/...
2220

2321
script:
24-
- go test -v ./... -coverprofile=coverage.txt -covermode=atomic
22+
- cd $GOPATH/src/aahframework.org/log
23+
- bash go.test.sh
2524

2625
after_success:
2726
- bash <(curl -s https://codecov.io/bash)

go.test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
echo "" > coverage.txt
5+
6+
for d in $(go list ./... | grep -v vendor); do
7+
go test -coverprofile=profile.out -covermode=atomic $d
8+
if [ -f profile.out ]; then
9+
cat profile.out >> coverage.txt
10+
rm profile.out
11+
fi
12+
done

prepare-aah-env.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
echo "Preparing aahframework custom environment for travis"
5+
6+
# export variables
7+
export PATH=$GOPATH/bin:$PATH
8+
export CURRENT_BRANCH="develop"
9+
export AAH_SRC_PATH=$GOPATH/src/aahframework.org
10+
11+
# find out current git branch
12+
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
13+
CURRENT_BRANCH="master"
14+
fi
15+
16+
# create aah src path
17+
mkdir -p $AAH_SRC_PATH
18+
19+
# get aah dependencies modules
20+
list_of_modules=$1
21+
if [ -n "$list_of_modules" ]; then
22+
for module in $list_of_modules; do
23+
git_path="git://github.com/go-aah/$module"
24+
dest_path="$AAH_SRC_PATH/$module"
25+
echo "Fetching $git_path"
26+
git clone -b $CURRENT_BRANCH $git_path $dest_path
27+
done
28+
fi
29+
30+
# go get dependencies
31+
current_module=$2
32+
current_module_path=$AAH_SRC_PATH/$current_module
33+
cp -rf "$GOPATH/src/github.com/go-aah/$current_module" "$AAH_SRC_PATH"
34+
35+
# update travis build directory
36+
export TRAVIS_BUILD_DIR=$current_module_path
37+
echo "TRAVIS_BUILD_DIR: $TRAVIS_BUILD_DIR"
38+
39+
# cleanup and change directory
40+
rm -rf $GOPATH/src/github.com/go-aah/*
41+
cd $current_module_path

0 commit comments

Comments
 (0)