Skip to content

Commit

Permalink
Merge pull request #40 from tapglue/improve-builds
Browse files Browse the repository at this point in the history
Improve builds
  • Loading branch information
xla authored Mar 30, 2017
2 parents 254f7c3 + 8ca35d3 commit f1af978
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 15 deletions.
9 changes: 7 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ machine:
version: 7.7.4
services:
- docker
- redis
- postgresql
- redis
dependencies:
cache_directories:
- "/home/ubuntu/.go_workspace"
- "/home/ubuntu/.gimme"
- "/home/ubuntu/.npm"
- "/home/ubuntu/libsysconfcpus"
- "/home/ubuntu/sysconfcpus"
- "/home/ubuntu/snaas/cmd/console/tests/elm-stuff"
override:
- ./infrastructure/scripts/dependencies
pre:
Expand All @@ -20,7 +24,8 @@ database:
- PGPASSWORD=unicode psql -U ubuntu -d circle_test -f platform/pg/setup.sql -h 127.0.0.1
test:
override:
- ./infrastructure/scripts/execute-tests
- ./infrastructure/scripts/execute-go-tests
- ./infrastructure/scripts/execute-elm-tests
deployment:
docker:
branch: master
Expand Down
32 changes: 23 additions & 9 deletions infrastructure/scripts/dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,36 @@ echo "|> install gimme"
sudo curl -sL -o /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
sudo chmod +x /usr/local/bin/gimme

echo "|> install go"
echo "|> install Go"
gimme 1.7.5
source ~/.gimme/envs/go1.7.5.env

echo "|> install static asset tool"
go get github.com/mjibson/esc

echo "|> install Elm tooling"
npm install -g elm
npm install -g elm-test

echo "|> install sysconf"
cd /home/ubuntu
if [ ! -d sysconfcpus/bin ];
then
git clone https://github.com/obmarg/libsysconfcpus.git
cd libsysconfcpus
./configure --prefix=/home/ubuntu/sysconfcpus
make && make install
fi

echo "|> install Elm packages"
cd /home/ubuntu/snaas/cmd/console/tests
elm-package install -y

echo "|> prepare directories"
mkdir -p /home/ubuntu/.go_workspace/src/github.com/tapglue
rm -rf /home/ubuntu/.go_workspace/src/github.com/tapglue/snaas
cp -R /home/ubuntu/snaas /home/ubuntu/.go_workspace/src/github.com/tapglue/

echo "|> install packages"
echo "|> install Go packages"
cd /home/ubuntu/.go_workspace/src/github.com/tapglue/snaas
go get -d -v ./...

echo "|> install static asset tool"
go get github.com/mjibson/esc

echo "|> install Elm tooling"
npm install -g elm
npm install -g elm-test
8 changes: 8 additions & 0 deletions infrastructure/scripts/execute-elm-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e
set -o pipefail

echo "|> execute Elm tests"
cd /home/ubuntu/snaas/cmd/console
/home/ubuntu/sysconfcpus/bin/sysconfcpus -n 2 make test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,3 @@ go test \
-tags integration \
./service/... \
-postgres.url="postgres://ubuntu:[email protected]/circle_test?sslmode-disable"

echo "|> execute Elm tests"
cd /home/ubuntu/.go_workspace/src/github.com/tapglue/snaas/cmd/console
make test

0 comments on commit f1af978

Please sign in to comment.