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
Minor
Rich Turner0c3ec48761b3
diff --git a/.ci_cd/deploy.sh b/.ci_cd/deploy.shindex 48ad94344..0594ca925 100644--- a/.ci_cd/deploy.sh+++ b/.ci_cd/deploy.sh@@ -41,11 +41,11 @@ if [ -z "$OR_HOSTNAME" ]; thenfiHOST="$OR_HOSTNAME"-# Load SSH environment variables into this session-if [ -f "ssh.env" ]; then- echo "Loading SSH password environment variable: 'ssh.env'"+# Load temp environment variables into this session+if [ -f "temp.env" ]; then+ echo "Loading SSH password environment variable: 'temp.env'"set -a- . ./ssh.env+ . ./temp.envset +xfi@@ -62,8 +62,7 @@ if [ -d ".ci_cd/aws" ]; thencp -r .ci_cd/aws temp/fi-chmod +x temp/aws/*-chmod +x temp/host_int/*+chmod -R +rx temp/# Determine compose file to use and copy to temp dir (do this here as all env variables are loaded)if [ -z "$ENV_COMPOSE_FILE" ]; thendiff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.ymlindex 5cf144f07..fc3f77238 100644--- a/.github/workflows/ci_cd.yml+++ b/.github/workflows/ci_cd.yml@@ -691,66 +691,39 @@ jobs:os.system(f"echo 'Outputting .ci_cd/env/{env}.env to temp/env'")os.system(f"cat .ci_cd/env/{env}.env >> temp/env")- # Output inputs and secrets (spacial handling for SSH_KEY and SSH_PASSWORD)+ # Output inputs and secrets (spacial handling for SSH_KEY and some other variables)# _$ENV_ prefixed keys are output last (to override any non env specific keys)- # some sensitive secrets are excluded+ environment = (env if env else "").upper()+ prefix = "_" + environment + "_"+for key, value in inputsAndSecrets.items():if "." in key:continue++ # Look for env prefixed keysif 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":- continue- os.system(f"echo 'Secret found {key}...'")- if key == "SSH_KEY":- os.system(f"echo \"{value}\" > ssh.key")- elif key == "SSH_PASSWORD":- os.system(f"echo '{key}=\"{value}\"' > ssh.env")- else:- lines = len(value.split("\n"))- if lines > 1:- os.system(f"echo '{key}=\"' >> temp/env")- os.system(f"echo '{value}\"' >> temp/env")+ if key.startswith(prefix):+ key = key.replace(prefix, "")else:- os.system(f"echo '{key}=\"{value}\"' >> temp/env")-- for key, value in inputsAndSecrets.items():- if "." in key:- continue- if not key.startswith("_"):- continue- if key == "AWS_SECRET_ACCESS_KEY":- continue- if key == "AWS_ACCESS_KEY_ID":- continue+ continue+if key == "DOCKERHUB_PASSWORD":continueif key == "github_token":continue- environment = (env if env else "").upper()- prefix = "_" + environment + "_"- if not key.startswith(prefix):- continue- else:- key = key.replace(prefix, "")- os.system(f"echo 'Secret found {key}...'")- if key == "SSH_KEY":- os.system(f"echo \"{value}\" > ssh.key")- elif key == "SSH_PASSWORD":- os.system(f"echo '{key}=\"{value}\"' > ssh.env")- else:- lines = len(value.split("\n"))- if lines > 1:- os.system(f"echo '{key}=\"' >> temp/env")- os.system(f"echo '{value}\"' >> temp/env")+ else:+ os.system(f"echo 'Secret found {key}...'")+ if key == "SSH_KEY":+ os.system(f"echo \"{value}\" > ssh.key")+ elif key == "SSH_PASSWORD" or key == "AWS_ACCESS_KEY_ID" or key == "AWS_SECRET_ACCESS_KEY":+ os.system(f"echo '{key}=\"{value}\"' > temp.env")else:- os.system(f"echo '{key}=\"{value}\"' >> temp/env")+ lines = len(value.split("\n"))+ if lines > 1:+ os.system(f"echo '{key}=\"' >> temp/env")+ os.system(f"echo '{value}\"' >> temp/env")+ else:+ os.system(f"echo '{key}=\"{value}\"' >> temp/env")# Set CIDR environment variableif ipv4 is not None and ipv4 != '':