100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
CI/CD: minor
Rich Turnere13ecfc23f89
diff --git a/.ci_cd/aws/provision_host.sh b/.ci_cd/aws/provision_host.shindex 93812519e..21a7fd30e 100644--- a/.ci_cd/aws/provision_host.sh+++ b/.ci_cd/aws/provision_host.sh@@ -43,7 +43,7 @@ elsefi# Optionally login if AWS_ENABLED != 'true'-source "${awsDir}login.sh"+#source "${awsDir}login.sh"ACCOUNT_PROFILE=if [ -n "$ACCOUNT_NAME" ]; then@@ -55,7 +55,7 @@ fiSTACK_NAME=$(tr '.' '-' <<< "$HOST")# Check stack doesn't already exist-STATUS=$(aws cloudformation describe-stacks --stack-name $STACK_NAME --query "Stacks[0].StackStatus" --output text $ACCOUNT_PROFILE 2>/dev/null)+#STATUS=$(aws cloudformation describe-stacks --stack-name $STACK_NAME --query "Stacks[0].StackStatus" --output text $ACCOUNT_PROFILE 2>/dev/null)if [ -n "$STATUS" ] && [ "$STATUS" != 'DELETE_COMPLETE' ]; thenecho "Stack already exists for this host '$HOST' current status is '$STATUS'"@@ -78,7 +78,11 @@ elseif [ -n "$ACCOUNT_PROFILE" ]; then# Append caller account hosted zones- HOSTED_ZONES=$(aws route53 list-hosted-zones --query "HostedZones[?contains(Name, '$TLD_NAME.')].[Name,'true']" --output text)+ read -r -d '' HOSTED_ZONES << EOF+$HOSTED_ZONES+$(aws route53 list-hosted-zones --query "HostedZones[?contains(Name, '$TLD_NAME.')].[Name,'true']" --output text)+EOF+ echo "$HOSTED_ZONES"fiif [ -n "$HOSTED_ZONES" ]; then@@ -106,10 +110,15 @@ elseexit 1fifi+ breakfidone- i=$(($i+1))+ if [ -n "$DNSHostedZoneName" ]; then+ break+ fi++ i=$((i+1))donefi@@ -119,7 +128,7 @@ elseif [ -n "$DNSHostedZoneRoleArn" ]; thenPARAMS="$PARAMS ParameterKey=DNSHostedZoneRoleArn,ParameterValue=$DNSHostedZoneRoleArn"fi-+exit 1# Create standard stack resources in specified accountSTACK_ID=$(aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name $STACK_NAME --template-body file://$TEMPLATE_PATH --parameters $PARAMS --output text $ACCOUNT_PROFILE)diff --git a/.ci_cd/deploy.sh b/.ci_cd/deploy.shindex 2d71cb273..0bd89cae8 100644--- a/.ci_cd/deploy.sh+++ b/.ci_cd/deploy.sh@@ -208,6 +208,7 @@ $sshCommandPrefix ${hostStr} << EOFif [ "$ROLLBACK_ON_ERROR" == 'true' ]; thenecho "Moving old temp dir to temp_old"+ rm -fr temp_oldmv temp temp_old# Tag existing manager image with previous tag (current tag might not be available in docker hub anymore or it could have been overwritten)docker tag `docker images openremote/manager -q | head -1` openremote/manager:previousdiff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.ymlindex dd5f4a854..5cf144f07 100644--- a/.github/workflows/ci_cd.yml+++ b/.github/workflows/ci_cd.yml@@ -692,12 +692,21 @@ jobs:os.system(f"cat .ci_cd/env/{env}.env >> temp/env")# Output inputs and secrets (spacial handling for SSH_KEY and SSH_PASSWORD)- # _ENV_ prefixed keys are output last (to override any non env specific keys)+ # _$ENV_ prefixed keys are output last (to override any non env specific keys)+ # some sensitive secrets are excludedfor key, value in inputsAndSecrets.items():if "." in key:continueif key.startswith("_"):continue+ if key == "AWS_SECRET_ACCESS_KEY":+ continue+ if key == "AWS_ACCESS_KEY_ID":+ continue+ if key == "DOCKERHUB_PASSWORD":+ continue+ if key == "github_token":+ continueos.system(f"echo 'Secret found {key}...'")if key == "SSH_KEY":os.system(f"echo \"{value}\" > ssh.key")@@ -716,6 +725,14 @@ jobs:continueif not key.startswith("_"):continue+ if key == "AWS_SECRET_ACCESS_KEY":+ continue+ if key == "AWS_ACCESS_KEY_ID":+ continue+ if key == "DOCKERHUB_PASSWORD":+ continue+ if key == "github_token":+ continueenvironment = (env if env else "").upper()prefix = "_" + environment + "_"if not key.startswith(prefix):