From 983e6fe6bd3f7413b529aa3915baf4e49fb4d36f Mon Sep 17 00:00:00 2001 From: Zachariah Dzielinski <dzielinski_zachariah@bah.com> Date: Mon, 11 Jan 2021 18:53:48 +0000 Subject: [PATCH] BB-1084 - Clean up small errors / concerns in CI code --- .gitlab-ci.yml | 7 +++---- .gitlab-ci/jobs/networking/aws/.gitlab-ci.yml | 1 - scripts/deploy/01_deploy_bigbang.sh | 3 ++- scripts/deploy/02_wait_for_helmrealeases.sh | 2 +- scripts/semver_diff.sh | 0 tests/bash/01_virtualservices.sh | 2 +- tests/bash/02_non_ironbank.sh | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) mode change 100644 => 100755 scripts/deploy/02_wait_for_helmrealeases.sh mode change 100644 => 100755 scripts/semver_diff.sh mode change 100644 => 100755 tests/bash/02_non_ironbank.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f679ce797d..924b7e5f82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,7 +50,6 @@ pre vars: - echo "CHART_MR_VERSION=$CHART_MR_VERSION" >> variables.env - echo "CHART_MA_VERSION=$CHART_MA_VERSION" >> variables.env # obtain semver differences (subtract master version from mr verison) - - chmod +x ./scripts/semver_diff.sh - CHART_VERSION_DIFF=$(./scripts/semver_diff.sh $CHART_MR_VERSION $CHART_MA_VERSION) - IFS=. DIFF_ARR=(${CHART_VERSION_DIFF##*-}) - echo "CHART_VERSION_DIFF=$CHART_VERSION_DIFF" >> variables.env @@ -75,10 +74,10 @@ pre vars: - kubectl get helmrelease -A .deploy_bigbang: &deploy_bigbang - - for script in ./scripts/deploy/*.sh; do chmod +x $script && $script; done + - find ./scripts/deploy -type f -name '*.sh' | sort | xargs -r -I {} sh -c 'echo {} && sh {}' .test_bigbang: &test_bigbang - - for test in ./tests/bash/*.sh; do chmod +x $test && $test; done + - find ./tests -type f -name '*.sh' | sort | xargs -r -I {} sh -c 'echo {} && sh {}' clean install: stage: smoke tests @@ -285,7 +284,7 @@ aws/rke2/bigbang test: ## Move this yum install to the dockerfile for the builder ## putting it here now for a quick way to install dig - yum install bind-utils -y - - chmod +x scripts/hosts.sh && ./scripts/hosts.sh + - ./scripts/hosts.sh - *test_bigbang # Uninstall BigBang on RKE2 cluster on AWS diff --git a/.gitlab-ci/jobs/networking/aws/.gitlab-ci.yml b/.gitlab-ci/jobs/networking/aws/.gitlab-ci.yml index 19a63df259..395a62aa44 100644 --- a/.gitlab-ci/jobs/networking/aws/.gitlab-ci.yml +++ b/.gitlab-ci/jobs/networking/aws/.gitlab-ci.yml @@ -1,7 +1,6 @@ .calc_unique_cidr: &calc_unique_cidr - apk add python3 py3-boto3 - echo "Calculating unique cidr range for vpc" - - chmod 755 ../../../get-vpc.py - TF_VAR_vpc_cidr=$(terraform output vpc_cidr | tr -d '\n' | tr -d '\r' | grep 10) || TF_VAR_vpc_cidr=$(python3 ../../../get-vpc.py | tr -d '\n' | tr -d '\r') - echo "Using VPC CIDR $TF_VAR_vpc_cidr for $CLUSTER_NAME cluster" - export TF_VAR_vpc_cidr=$TF_VAR_vpc_cidr diff --git a/scripts/deploy/01_deploy_bigbang.sh b/scripts/deploy/01_deploy_bigbang.sh index 4e7feb5b9c..4a2d3e1e33 100755 --- a/scripts/deploy/01_deploy_bigbang.sh +++ b/scripts/deploy/01_deploy_bigbang.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + set -ex # Deploy flux and wait for it to be ready diff --git a/scripts/deploy/02_wait_for_helmrealeases.sh b/scripts/deploy/02_wait_for_helmrealeases.sh old mode 100644 new mode 100755 index b87bfa53f6..30621bad69 --- a/scripts/deploy/02_wait_for_helmrealeases.sh +++ b/scripts/deploy/02_wait_for_helmrealeases.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/scripts/semver_diff.sh b/scripts/semver_diff.sh old mode 100644 new mode 100755 diff --git a/tests/bash/01_virtualservices.sh b/tests/bash/01_virtualservices.sh index f317fc4631..4fff8b9027 100755 --- a/tests/bash/01_virtualservices.sh +++ b/tests/bash/01_virtualservices.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # exit on error set -e diff --git a/tests/bash/02_non_ironbank.sh b/tests/bash/02_non_ironbank.sh old mode 100644 new mode 100755 index 4967598126..944903c523 --- a/tests/bash/02_non_ironbank.sh +++ b/tests/bash/02_non_ironbank.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # exit on error set -e -- GitLab