diff --git a/.pluginsync.yml b/.pluginsync.yml index 1883d31..3fa509a 100644 --- a/.pluginsync.yml +++ b/.pluginsync.yml @@ -1,5 +1,5 @@ # File managed by pluginsync -pluginsync_config: '0.1.13' +pluginsync_config: '0.1.14' managed_files: - .github - .github/ISSUE_TEMPLATE.md diff --git a/.sync.yml b/.sync.yml index 015687b..07f4b61 100644 --- a/.sync.yml +++ b/.sync.yml @@ -17,6 +17,8 @@ matrix: - TEST_TYPE=small - TEST_TYPE=medium + - SNAP_VERSION: latest + TEST_TYPE: large - SNAP_VERSION: latest_build TEST_TYPE: large matrix: @@ -25,9 +27,3 @@ env: SNAP_VERSION=latest TEST_TYPE=large - go: 1.7.x env: SNAP_VERSION=latest_build TEST_TYPE=large - deploy: - access_key_id: AKIAINMB43VSSPFZISAA - secret_access_key: - secure: K2AnEm2FcP0wEQ1rWJzkASpLUBHeICjwFxYGiq44HB3KTj/4G4MYtSIxYjWdG9C81sfCbC+wMHyWla8rRrVOxeMTBeJpoBNoX8wo3gAwetfA3DkVyN51xTsiHUa7yhjDjxD9scrGsJlwO+d9zyk63RU9rQGKxoDudlBvtfEat+Uke6Oq0rcUSXzqBF9ejLwscLYlFTmz+NfeACcvVqsB1Ht5RpR/VuqFXwpfmj/G+3YBx6RYQQempltL+JZUzT8UhHpQJf2sp148i/T/jqM4Agwmu398G61Jeu3t7ESDnvA37t+1hmmDq88AOveEp3pbOThCS/4ycbL2DRRns6aQnrZgBbVvHxY/ZdSWsyjVbqBQJCguo4BF0hyDdnfSi8mbkwcRf9XSSftwHxW0NyWPYhg/GASf2lKsrGG7UGZoUmMgb/jJ03sEdwjqzB+ICDa+Txhhmikxgwqfj0hyDXbHYmPNSwQ5TYI35upiEj8X8fERceFYgKGUCmphqsKtZq4iPcdKqJ4xBtHmKLutk2YqkDuKPUrx96/3kSTTF8OfaSU3+bipFcOyo48TLc/QEaag4MRoPU+L47xRwlSrZFFFrioVmFjxgY8yOoN0yRuc9XccMmmEzApa621OlzMjyduMw8UG5/+tXcmOOlcM1n2p+RqtJ/Vi0/9oyG7AxeP4mj8= - api_key: - secure: BxPzO6z768C2Sc6lijoRJNhMiL+HnUfcLWXB99WVQM++OaY+3t98EjabETvPfgCfl3gxyBrTnfn3umuj3dbFCSspptY+mnI/sjvvu3yfHMOPOGT+5yhPzBir+WA5GN4gAlAwvOoMYTUJf//An7b4Pa+98Tz52MJMtYvNPTtHmG8K4G6xhWRtkuIRp7jMrBJpp27RHBW03csBcX+wYwaPjTtRev4/VhnbQxquSq6EYWSXlxBPNt24y2zQJ5qcFs50XEz6FVzXp9S4rN9ngVbCHfdmwM/JxJCoeKgjDJErVb8VISNUHUHTin+4vtAU4ypheyWzxNcpGeCIECd7eNSwXFoCAZlmJIORDiWX3BlE7Hjxn+J3h0hw2EkOt6B/ReaY0fdg88xWZCGgUYiXTt4EQ7h0XugpQjTme/3w0efWufikwvgJi7EG1ITKTmTwvh8ps8IkU9WigIqcTacTLE051EIVhVsiUZJsuGgIdhQ3d3XCGS500GxNifrTxovOu2l0D3DKXoMbzt9quDHWSU28iJZsnAaYAKGt1M4rvahuC0KQ2d64Qcy4qIzoFc2O2FY9xqZGYAn0h0uPdzCgBj9FoHu3D/YEUDM7XTTws0hVT94/HpDcCiqd4zuE95cD0fHCjQfCWOBf9qMxbKWTAyHslMGtTwlIFL1IaAjLNpyI3SI= diff --git a/.travis.yml b/.travis.yml index e9b1505..7387f51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ env: matrix: - TEST_TYPE=small - TEST_TYPE=medium + - SNAP_VERSION: latest + TEST_TYPE: large - SNAP_VERSION: latest_build TEST_TYPE: large - TEST_TYPE=build @@ -39,7 +41,8 @@ before_deploy: - "./scripts/pre_deploy.sh" deploy: - provider: s3 - access_key_id: AKIAINMB43VSSPFZISAA + access_key_id: $AWS_ACCESS_KEY_ID + secret_access_key: $AWS_SECRET_ACCESS_KEY secret_access_key: secure: K2AnEm2FcP0wEQ1rWJzkASpLUBHeICjwFxYGiq44HB3KTj/4G4MYtSIxYjWdG9C81sfCbC+wMHyWla8rRrVOxeMTBeJpoBNoX8wo3gAwetfA3DkVyN51xTsiHUa7yhjDjxD9scrGsJlwO+d9zyk63RU9rQGKxoDudlBvtfEat+Uke6Oq0rcUSXzqBF9ejLwscLYlFTmz+NfeACcvVqsB1Ht5RpR/VuqFXwpfmj/G+3YBx6RYQQempltL+JZUzT8UhHpQJf2sp148i/T/jqM4Agwmu398G61Jeu3t7ESDnvA37t+1hmmDq88AOveEp3pbOThCS/4ycbL2DRRns6aQnrZgBbVvHxY/ZdSWsyjVbqBQJCguo4BF0hyDdnfSi8mbkwcRf9XSSftwHxW0NyWPYhg/GASf2lKsrGG7UGZoUmMgb/jJ03sEdwjqzB+ICDa+Txhhmikxgwqfj0hyDXbHYmPNSwQ5TYI35upiEj8X8fERceFYgKGUCmphqsKtZq4iPcdKqJ4xBtHmKLutk2YqkDuKPUrx96/3kSTTF8OfaSU3+bipFcOyo48TLc/QEaag4MRoPU+L47xRwlSrZFFFrioVmFjxgY8yOoN0yRuc9XccMmmEzApa621OlzMjyduMw8UG5/+tXcmOOlcM1n2p+RqtJ/Vi0/9oyG7AxeP4mj8= bucket: snap.ci.snap-telemetry.io @@ -51,11 +54,10 @@ deploy: on: repo: intelsdi-x/snap-plugin-publisher-influxdb branch: master - condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8\.[0-9]+$ + condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8(|\.[0-9]+)$ - provider: s3 - access_key_id: AKIAINMB43VSSPFZISAA - secret_access_key: - secure: K2AnEm2FcP0wEQ1rWJzkASpLUBHeICjwFxYGiq44HB3KTj/4G4MYtSIxYjWdG9C81sfCbC+wMHyWla8rRrVOxeMTBeJpoBNoX8wo3gAwetfA3DkVyN51xTsiHUa7yhjDjxD9scrGsJlwO+d9zyk63RU9rQGKxoDudlBvtfEat+Uke6Oq0rcUSXzqBF9ejLwscLYlFTmz+NfeACcvVqsB1Ht5RpR/VuqFXwpfmj/G+3YBx6RYQQempltL+JZUzT8UhHpQJf2sp148i/T/jqM4Agwmu398G61Jeu3t7ESDnvA37t+1hmmDq88AOveEp3pbOThCS/4ycbL2DRRns6aQnrZgBbVvHxY/ZdSWsyjVbqBQJCguo4BF0hyDdnfSi8mbkwcRf9XSSftwHxW0NyWPYhg/GASf2lKsrGG7UGZoUmMgb/jJ03sEdwjqzB+ICDa+Txhhmikxgwqfj0hyDXbHYmPNSwQ5TYI35upiEj8X8fERceFYgKGUCmphqsKtZq4iPcdKqJ4xBtHmKLutk2YqkDuKPUrx96/3kSTTF8OfaSU3+bipFcOyo48TLc/QEaag4MRoPU+L47xRwlSrZFFFrioVmFjxgY8yOoN0yRuc9XccMmmEzApa621OlzMjyduMw8UG5/+tXcmOOlcM1n2p+RqtJ/Vi0/9oyG7AxeP4mj8= + access_key_id: $AWS_ACCESS_KEY_ID + secret_access_key: $AWS_SECRET_ACCESS_KEY bucket: snap.ci.snap-telemetry.io region: us-west-2 skip_cleanup: true @@ -65,10 +67,9 @@ deploy: on: repo: intelsdi-x/snap-plugin-publisher-influxdb tags: true - condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8\.[0-9]+$ + condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8(|\.[0-9]+)$ - provider: releases - api_key: - secure: BxPzO6z768C2Sc6lijoRJNhMiL+HnUfcLWXB99WVQM++OaY+3t98EjabETvPfgCfl3gxyBrTnfn3umuj3dbFCSspptY+mnI/sjvvu3yfHMOPOGT+5yhPzBir+WA5GN4gAlAwvOoMYTUJf//An7b4Pa+98Tz52MJMtYvNPTtHmG8K4G6xhWRtkuIRp7jMrBJpp27RHBW03csBcX+wYwaPjTtRev4/VhnbQxquSq6EYWSXlxBPNt24y2zQJ5qcFs50XEz6FVzXp9S4rN9ngVbCHfdmwM/JxJCoeKgjDJErVb8VISNUHUHTin+4vtAU4ypheyWzxNcpGeCIECd7eNSwXFoCAZlmJIORDiWX3BlE7Hjxn+J3h0hw2EkOt6B/ReaY0fdg88xWZCGgUYiXTt4EQ7h0XugpQjTme/3w0efWufikwvgJi7EG1ITKTmTwvh8ps8IkU9WigIqcTacTLE051EIVhVsiUZJsuGgIdhQ3d3XCGS500GxNifrTxovOu2l0D3DKXoMbzt9quDHWSU28iJZsnAaYAKGt1M4rvahuC0KQ2d64Qcy4qIzoFc2O2FY9xqZGYAn0h0uPdzCgBj9FoHu3D/YEUDM7XTTws0hVT94/HpDcCiqd4zuE95cD0fHCjQfCWOBf9qMxbKWTAyHslMGtTwlIFL1IaAjLNpyI3SI= + api_key: $GITHUB_API_KEY file: - release/snap-plugin-publisher-influxdb_linux_x86_64 - release/snap-plugin-publisher-influxdb_darwin_x86_64 @@ -76,4 +77,4 @@ deploy: on: repo: intelsdi-x/snap-plugin-publisher-influxdb tags: true - condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8\.[0-9]+$ + condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION =~ ^1\.8(|\.[0-9]+)$ diff --git a/scripts/build.sh b/scripts/build.sh index dd1f612..f3cac2b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync # http://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/scripts/common.sh b/scripts/common.sh index 9cbe2db..898730b 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync # http://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/scripts/deps.sh b/scripts/deps.sh index 1657a7f..6a0b805 100755 --- a/scripts/deps.sh +++ b/scripts/deps.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync # http://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/scripts/large.sh b/scripts/large.sh index 6834275..6715a7b 100755 --- a/scripts/large.sh +++ b/scripts/large.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync set -e diff --git a/scripts/pre_deploy.sh b/scripts/pre_deploy.sh index 9a57824..80482e3 100755 --- a/scripts/pre_deploy.sh +++ b/scripts/pre_deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync # http://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/scripts/test.sh b/scripts/test.sh index 3b2cad2..774a2cf 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # File managed by pluginsync # http://www.apache.org/licenses/LICENSE-2.0.txt diff --git a/scripts/test/large_spec.rb b/scripts/test/large_spec.rb index c95abd0..0c8c548 100644 --- a/scripts/test/large_spec.rb +++ b/scripts/test/large_spec.rb @@ -6,16 +6,21 @@ compose_yml = File.expand_path(File.join(__FILE__, "../docker-compose.yml")) raise(Exception, "Missing docker-compose file: #{compose_yml}") unless File.exists? compose_yml - # NOTE: scan docker compose file and pull latest containers: - images = File.readlines(compose_yml).select {|l| l =~ /^\s*image:/} - images = images.collect{|l| l.split('image:').last.strip }.uniq - images.each do |i| - puts `docker pull #{i}` - end +# NOTE: scan docker compose file and pull latest containers: +images = File.readlines(compose_yml).select {|l| l =~ /^\s*image:/} +images = images.collect{|l| l.split('image:').last.strip }.uniq +images.each do |i| + puts `docker pull #{i}` +end set :docker_compose_container, :snap describe docker_compose(compose_yml) do + + # NOTE: If you need to wait for a service or create a database perform it in setup.rb + setup = File.expand_path(File.join(__FILE__, '../setup.rb')) + eval File.read setup if File.exists? setup + its_container(:snap) do describe 'docker-compose.yml run' do TIMEOUT = 60 @@ -85,7 +90,7 @@ describe "Metrics in running tasks" do it { binding.pry if ENV["DEMO"] == "true" - + data = curl_json_api("http://127.0.0.1:8181/v1/tasks") task = data["body"]["ScheduledTasks"].find{|i| i['id'] == task_id} expect(task['id']).to eq task_id @@ -121,4 +126,8 @@ end end end + + # NOTE: If you need to perform additional checks such as database verification it be done at the end: + verify = File.expand_path(File.join(__FILE__, '../verify.rb')) + eval File.read verify if File.exists? verify end diff --git a/scripts/test/spec_helper.rb b/scripts/test/spec_helper.rb index d2d3613..1173251 100644 --- a/scripts/test/spec_helper.rb +++ b/scripts/test/spec_helper.rb @@ -172,7 +172,7 @@ def load_all_plugins c.include SnapUtils if ENV["DEMO"] == "true" then Pry.config.pager = false - + Pry.hooks.add_hook(:before_session, "notice") do |output, binding, pry| output.puts "Setup complete for DEMO mode. When you are finished checking out Snap please type 'exit-program' to shutdown containers." end