diff --git a/circle.yml b/circle.yml index bc68ef7..5d51a9f 100644 --- a/circle.yml +++ b/circle.yml @@ -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: @@ -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 diff --git a/infrastructure/scripts/dependencies b/infrastructure/scripts/dependencies index ecc6abd..f440259 100755 --- a/infrastructure/scripts/dependencies +++ b/infrastructure/scripts/dependencies @@ -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 \ No newline at end of file diff --git a/infrastructure/scripts/execute-elm-tests b/infrastructure/scripts/execute-elm-tests new file mode 100755 index 0000000..d57c0ce --- /dev/null +++ b/infrastructure/scripts/execute-elm-tests @@ -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 diff --git a/infrastructure/scripts/execute-tests b/infrastructure/scripts/execute-go-tests similarity index 81% rename from infrastructure/scripts/execute-tests rename to infrastructure/scripts/execute-go-tests index 83d20e6..46d0f31 100755 --- a/infrastructure/scripts/execute-tests +++ b/infrastructure/scripts/execute-go-tests @@ -30,7 +30,3 @@ go test \ -tags integration \ ./service/... \ -postgres.url="postgres://ubuntu:unicode@127.0.0.1/circle_test?sslmode-disable" - -echo "|> execute Elm tests" -cd /home/ubuntu/.go_workspace/src/github.com/tapglue/snaas/cmd/console -make test