Skip to content

Commit

Permalink
Overhaul build process (closes #195)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu committed Jun 28, 2019
1 parent 3e74c07 commit 175cd71
Show file tree
Hide file tree
Showing 30 changed files with 338 additions and 287 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store*
.vagrant
ubuntu*.log
33 changes: 21 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
---
sudo: required
dist: trusty
dist: xenial
language: go

go:
- 1.8

services:
- postgresql
go: 1.12

before_install:
- openssl aes-256-cbc -K $encrypted_44efaf791086_key -iv $encrypted_44efaf791086_iv -in BIN.enc -out BIN -d
- export GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/BIN
- sudo apt-get update -qq
- sudo apt-get install -y language-pack-en python-pip python-paramiko=1.16.0-1ubuntu0.2 libffi-dev libssl-dev python-dev
- sudo pip install --upgrade pip

install:
- sudo pip install setuptools
- sudo pip install ansible
- sudo pip install markupsafe==1.1.1
- sudo pip install setuptools==40.8.0
- sudo pip install ansible==2.8.1

before_script: ansible-playbook -i provisioning/inventory provisioning/local_setup.yml --connection=local --become

before_script:
- ansible-playbook -i provisioning/inventory provisioning/with_building_ui_and_go_projects.yml --connection=local --sudo
script: ./integration/integration_test.sh

script:
- ./integration/integration_test.sh
deploy:
- provider: script
# travis builds timeout after 10 min of not seeing any output, hence the below work-around
# default travis_wait method doesn't show output until command finishes while this way allows us to see it
script: (while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done &) && (./.travis/deploy.sh $TRAVIS_TAG)
skip_cleanup: true
on:
condition: '"$(.travis/is_valid_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
tags: true

env:
global:
Expand Down
93 changes: 93 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash
set -e

cd $TRAVIS_BUILD_DIR

###### input validation ######
if [ "$#" -ne 1 ]
then
echo "Inappropriate number of arguments! Aborted."
echo "Usage: deploy.sh tag"
exit 1
else
export SP_MINI_PLATFORM=`echo $1 | cut -d'/' -f2`
export SP_MINI_SIZE=`echo $1 | cut -d'/' -f3`

if [ "$SP_MINI_PLATFORM" == "aws" -o "$SP_MINI_PLATFORM" == "gcp" ]
then
echo "Platform recognized!"
else
echo "Unrecognized platform! Aborted."
echo "Supported platforms; aws, gcp."
exit 1
fi

if [ "$SP_MINI_SIZE" == "large" ]
then
# prepare env vars for docker-compose
# to be used as -Xmx jvm option for Elasticsearch & Snowplow apps
echo -n > provisioning/roles/docker/files/.env
echo "ES_JVM_SIZE=4g" >> provisioning/roles/docker/files/.env
echo "SP_JVM_SIZE=512m" >> provisioning/roles/docker/files/.env
# prepare env var for packer
# to be used to determine which instance type to use
if [ "$SP_MINI_PLATFORM" == "aws" ]
then
export AWS_INSTANCE_TYPE=t2.large
elif [ "$SP_MINI_PLATFORM" == "gcp" ]
then
export GCP_MACHINE_TYPE=n1-standard-2
fi
elif [ "$SP_MINI_SIZE" == "xlarge" ]
then
# prepare env vars for docker-compose
# to be used as -Xmx jvm option for Elasticsearch & Snowplow apps
echo -n > provisioning/roles/docker/files/.env
echo "ES_JVM_SIZE=8g" >> provisioning/roles/docker/files/.env
echo "SP_JVM_SIZE=1536m" >> provisioning/roles/docker/files/.env
# prepare env var for packer
# to be used to determine which instance type to use
if [ "$SP_MINI_PLATFORM" == "aws" ]
then
export AWS_INSTANCE_TYPE=t2.xlarge
elif [ "$SP_MINI_PLATFORM" == "gcp" ]
then
export GCP_MACHINE_TYPE=n1-standard-4
fi
elif [ "$SP_MINI_SIZE" == "xxlarge" ]
then
# prepare env vars for docker-compose
# to be used as -Xmx jvm option for Elasticsearch & Snowplow apps
echo -n > provisioning/roles/docker/files/.env
echo "ES_JVM_SIZE=16g" >> provisioning/roles/docker/files/.env
echo "SP_JVM_SIZE=3g" >> provisioning/roles/docker/files/.env
# prepare env var for packer
# to be used to determine which instance type to use
if [ "$SP_MINI_PLATFORM" == "aws" ]
then
export AWS_INSTANCE_TYPE=t2.2xlarge
elif [ "$SP_MINI_PLATFORM" == "gcp" ]
then
export GCP_MACHINE_TYPE=n1-standard-8
fi
else
echo "Unrecognized size! Aborted."
echo "Available sizes; large, xlarge and xxlarge."
exit 1
fi
fi

############## deployment ###################

if [ "$SP_MINI_PLATFORM" == "aws" ]
then
export AWS_ACCESS_KEY_ID=$AWS_DEPLOY_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=$AWS_DEPLOY_SECRET_KEY
packer build -only=amazon-ebs Packerfile.json
elif [ "$SP_MINI_PLATFORM" == "gcp" ]
then
packer build -only=googlecompute Packerfile.json
else
echo "Unrecognized platform. Aborted."
exit 1
fi
25 changes: 25 additions & 0 deletions .travis/is_valid_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

tag=$1

tag_version=`echo $tag | cut -d'/' -f1`
tag_platform=`echo $tag | cut -d'/' -f2`
tag_flavor=`echo $tag | cut -d'/' -f3`

version=`cat ${TRAVIS_BUILD_DIR}/VERSION`

if [ "${tag_version}" == "${version}" ]; then
if [ "${tag_platform}" == "aws" ] || [ "${tag_platform}" == "gcp" ]; then
if [ "${tag_flavor}" == "large" ] || [ "${tag_flavor}" == "xlarge" ] || [ "${tag_flavor}" == "xxlarge" ]; then
exit 0
fi
echo "Tag flavor is not valid!"
exit 1
fi
echo "Tag platform is not valid!"
exit 1
else
echo "Tag version doesn't match VERSION file!"
exit 1
fi
Binary file added BIN.enc
Binary file not shown.
10 changes: 6 additions & 4 deletions Packerfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ssh_username": "ubuntu",
"tags": {
"OS_Version": "Ubuntu-16.04",
"Release": "{{user `version`}}"
"Release": "{{user `aws_version`}}"
},
"type": "amazon-ebs"
},
Expand All @@ -22,7 +22,6 @@
"image_description": "Snowplow Mini - The Snowplow Pipeline in a box",
"image_name": "snowplow-mini-{{user `gcp_version`}}-{{user `sp_mini_size`}}-{{timestamp}}",
"machine_type": "{{user `gcp_machine_type`}}",
"account_file": "account.json",
"project_id": "snowplow-images",
"source_image_family": "ubuntu-1604-lts",
"ssh_username": "ubuntu",
Expand All @@ -32,8 +31,11 @@
"post-processors": [],
"provisioners": [
{
"playbook_file": "provisioning/without_building_ui_and_go_projects.yml",
"type": "ansible"
"playbook_file": "provisioning/publish.yml",
"type": "ansible",
"extra_arguments": [
"--become"
]
}
],
"variables": {
Expand Down
17 changes: 0 additions & 17 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,4 @@ Vagrant.configure("2") do |config|
config.vm.provision :shell do |sh|
sh.path = "vagrant/up.bash"
end

# Requires Vagrant 1.7.0+
config.push.define "publish", strategy: "local-exec" do |push|
push.inline = <<-SCRIPT
# comment/uncomment below to enable/disable pushing to AWS/GCP
# or configure instance type large/xlarge/xxlarge
# vagrant/push.bash aws large
# vagrant/push.bash aws xlarge
# vagrant/push.bash aws xxlarge
# vagrant/push.bash gcp large
# vagrant/push.bash gcp xlarge
# vagrant/push.bash gcp xxlarge
SCRIPT
end

end
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/snowplow/snowplow-mini

go 1.12

require (
github.com/jinzhu/inflection v0.0.0-20190603042836-f5c5f50e6090 // indirect
github.com/mholt/caddy v1.0.0 // indirect
gopkg.in/pg.v5 v5.3.3 // indirect
)
93 changes: 93 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115 h1:fUjoj2bT6dG8LoEe+uNsKk8J+sLkDbQkJnB6Z1F02Bc=
github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU=
github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9 h1:a1zrFsLFac2xoM6zG1u72DWJwZG3ayttYLfmLbxVETk=
github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-acme/lego v2.5.0+incompatible h1:5fNN9yRQfv8ymH3DSsxla+4aYeQt2IgfZqHKVnK8f0s=
github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 h1:UnszMmmmm5vLwWzDjTFVIkfhvWF1NdrmChl8L2NUDCw=
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a h1:BcF8coBl0QFVhe8vAMMlD+CV8EISiu9MGKLoj6ZEyJA=
github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a/go.mod h1:wK6yTYYcgjHE1Z1QtXACPDjcFJyBskHEdagmnq3vsP8=
github.com/jinzhu/inflection v0.0.0-20190603042836-f5c5f50e6090 h1:LIwA5USOJ9W/0hwiRH1MugeThGBHGqv+USXcDKWHIVY=
github.com/jinzhu/inflection v0.0.0-20190603042836-f5c5f50e6090/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f h1:sSeNEkJrs+0F9TUau0CgWTTNEwF23HST3Eq0A+QIx+A=
github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04=
github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk=
github.com/lucas-clemente/quic-go v0.10.2 h1:iQtTSZVbd44k94Lu0U16lLBIG3lrnjDvQongjPd4B/s=
github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao=
github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced h1:zqEC1GJZFbGZA0tRyNZqRjep92K5fujFtFsu5ZW7Aug=
github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58=
github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk=
github.com/mholt/caddy v1.0.0 h1:KI6RPGih2GFzWRPG8s9clKK28Ns4ZlVMKR/v7mxq6+c=
github.com/mholt/caddy v1.0.0/go.mod h1:PzUpQ3yGCTuEuy0KSxEeB4TZOi3zBZ8BR/zY0RBP414=
github.com/mholt/certmagic v0.5.0 h1:lYXxsLUFya/I3BgDCrfuwcMQOB+4auzI8CCzpK41tjc=
github.com/mholt/certmagic v0.5.0/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY=
github.com/miekg/dns v1.1.3 h1:1g0r1IvskvgL8rR+AcHzUA+oFmGcQlaIm4IqakufeMM=
github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/naoina/go-stringutil v0.1.0 h1:rCUeRUHjBjGTSHl0VC00jUPLz8/F9dDzYI70Hzifhks=
github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0=
github.com/naoina/toml v0.1.1 h1:PT/lllxVVN0gzzSqSlHEmP8MJB4MY2U7STGxiouV4X8=
github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4 h1:S9YlS71UNJIyS61OqGAmLXv3w5zclSidN+qwr80XxKs=
github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190328230028-74de082e2cca h1:hyA6yiAgbUwuWqtscNvWAI7U1CtlaD1KilQ6iudt1aI=
golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e h1:ZytStCyV048ZqDsWHiYDdoI2Vd4msMcrDECFxS+tL9c=
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/pg.v5 v5.3.3 h1:WGfb/lVyakKS3dFgAu5KOab/vHrNZYHPbLYkjKQuVJo=
gopkg.in/pg.v5 v5.3.3/go.mod h1:A7QNerFceY0s3tPuavny+PCy6m9RQ9LrsF3onyQVvNc=
gopkg.in/square/go-jose.v2 v2.2.2 h1:orlkJ3myw8CN1nVQHBFfloD+L3egixIa4FvUP6RosSA=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion integration/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ while [ $COUNTER -lt 10 ]; do
curl http://localhost:8080/i
let COUNTER=COUNTER+1
done
sleep 90
sleep 120

# Assertions
good_count="$(curl --silent -XGET 'http://localhost:9200/good/good/_count' | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["count"]')"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
# This playbook is used for provisioning of the vagrant machine.
# All tools for compilation of the Control Plane API, Caddy Server
# and UI is setup to the vagrant machine in here.
# Additionally, Snowplow Mini environment is made ready to use locally.
- name: apply all scripts
hosts: all

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion provisioning/resources/configs/control-plane-api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stream_enrich = "stream-enrich"
es_loader_good = "elasticsearch-loader-good"
es_loader_bad = "elasticsearch-loader-bad"
iglu = "iglu-server"
caddy = "caddy_init"
caddy = "caddy"

[PSQL]
user = "snowplow"
Expand Down
2 changes: 2 additions & 0 deletions provisioning/resources/control-plane/restart_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func restartService(service string) error {
restartCommandArgs := []string{"-f", "/home/ubuntu/snowplow/docker-compose.yml",
"restart", val}
cmd := exec.Command("/usr/local/bin/docker-compose", restartCommandArgs...)
cmd.Dir = "/home/ubuntu/snowplow"
err := cmd.Run()
if err != nil {
return err
Expand All @@ -60,6 +61,7 @@ func restartService(service string) error {
func restartSPServices() error {
restartCommandArgs := []string{"-f", "/home/ubuntu/snowplow/docker-compose.yml", "restart"}
cmd := exec.Command("/usr/local/bin/docker-compose", restartCommandArgs...)
cmd.Dir = "/home/ubuntu/snowplow"
err := cmd.Run()
if err != nil {
return err
Expand Down
Loading

0 comments on commit 175cd71

Please sign in to comment.