Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve builds #40

Merged
merged 6 commits into from
Mar 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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