mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-16 03:49:52 +00:00
Merge commit 'b92447c6abbc8f8e6f1d33a8a4c961ba340dbf23' into secure-integration-tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
15
tools/lint
15
tools/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
|
||||
|
||||
Reference in New Issue
Block a user