From 4c4b21ec663a7a7bd55727c978677a22f495259e Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 8 Mar 2017 14:43:33 +0000 Subject: [PATCH 1/2] Revert "Don't run integration tests, as the VMs are being compromised." This reverts commit 093c21c2076a98d4fd9edf96395c4a79105ed86b. --- circle.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/circle.yml b/circle.yml index 050fe8fa4..6c4a9c5e3 100644 --- a/circle.yml +++ b/circle.yml @@ -54,20 +54,20 @@ test: parallel: true - cd $SRCDIR/extras; ./build_on_circle.sh: parallel: true -# - "test -z \"$SECRET_PASSWORD\" || (cd $SRCDIR/integration; ./gce.sh setup && eval $(./gce.sh hosts); ./setup.sh)": -# parallel: true -# - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./run_all.sh): -# parallel: true -# timeout: 300 -# post: -# - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh destroy): -# parallel: true -# - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; ./tools/cover/gather_coverage.sh ./coverage $SRCDIR/coverage): -# parallel: true -# - test "$CIRCLE_NODE_INDEX" != "0" || (goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/profile.cov -service=circleci || true): -# parallel: true -# - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; cp scope.tar $CIRCLE_ARTIFACTS): -# parallel: true + - "test -z \"$SECRET_PASSWORD\" || (cd $SRCDIR/integration; ./gce.sh setup && eval $(./gce.sh hosts); ./setup.sh)": + parallel: true + - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./run_all.sh): + parallel: true + timeout: 300 + post: + - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh destroy): + parallel: true + - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; ./tools/cover/gather_coverage.sh ./coverage $SRCDIR/coverage): + parallel: true + - test "$CIRCLE_NODE_INDEX" != "0" || (goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/profile.cov -service=circleci || true): + parallel: true + - test "$CIRCLE_NODE_INDEX" != "0" || (cd $SRCDIR; cp scope.tar $CIRCLE_ARTIFACTS): + parallel: true deployment: hub: From b92447c6abbc8f8e6f1d33a8a4c961ba340dbf23 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 8 Mar 2017 16:23:04 +0000 Subject: [PATCH 2/2] Squashed 'tools/' changes from 52d695c..9e32194 9e32194 Secure GCP servers for Scope: open port 80. a22536a Secure GCP servers for Scope. 89c3a29 Merge pull request #78 from weaveworks/lint-merge-rebase-issue-in-docs 73ad56d Add linter function to avoid bad merge/rebase artefact git-subtree-dir: tools git-subtree-split: 9e32194cf16f8f6eee7acb5dbf311c9003f0fedb --- integration/gce.sh | 9 ++++++++- lint | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/integration/gce.sh b/integration/gce.sh index e52a85739..5c3940184 100755 --- a/integration/gce.sh +++ b/integration/gce.sh @@ -44,6 +44,10 @@ function vm_names() { # Delete all vms in this account function destroy() { local names + # shellcheck disable=SC2046 + if [ $(gcloud compute firewall-rules list "test-allow-docker$SUFFIX" 2>/dev/null | wc -l) -gt 0 ]; then + gcloud compute firewall-rules delete "test-allow-docker$SUFFIX" + fi names="$(vm_names)" # shellcheck disable=SC2086 if [ "$(gcloud compute instances list --zones "$ZONE" -q $names | wc -l)" -le 1 ]; then @@ -116,7 +120,10 @@ function setup() { destroy names=($(vm_names)) - gcloud compute instances create "${names[@]}" --image "$TEMPLATE_NAME" --zone "$ZONE" + gcloud compute instances create "${names[@]}" --image "$TEMPLATE_NAME" --zone "$ZONE" --tags "test$SUFFIX" --network=test + my_ip="$(curl -s http://ipinfo.io/ip)" + gcloud compute firewall-rules create "test-allow-docker$SUFFIX" --network=test --allow tcp:2375,tcp:12375,tcp:4040,tcp:80 --target-tags "test$SUFFIX" --source-ranges "$my_ip" + gcloud compute config-ssh --ssh-key-file "$SSH_KEY_FILE" sed -i '/UserKnownHostsFile=\/dev\/null/d' ~/.ssh/config diff --git a/lint b/lint index b9428d9f2..1589bd9ed 100755 --- a/lint +++ b/lint @@ -139,6 +139,20 @@ lint_tf() { return $lint_result } +lint_md() { + local filename="$1" + local lint_result=0 + + for i in '=======' '>>>>>>>'; do + if grep -q "${i}" "${filename}"; then + lint_result=1 + echo "${filename}: bad merge/rebase!" + fi + done + + return $lint_result +} + lint() { filename="$1" ext="${filename##*\.}" @@ -164,6 +178,7 @@ lint() { go) lint_go "${filename}" || lint_result=1 ;; sh) lint_sh "${filename}" || lint_result=1 ;; tf) lint_tf "${filename}" || lint_result=1 ;; + md) lint_md "${filename}" || lint_result=1 ;; esac spell_check "${filename}" || lint_result=1