new menu, trying to keep envs, faster api calls etc
Some checks failed
Build Images and Deploy / Update-PROD-Stack (push) Failing after 18s
Some checks failed
Build Images and Deploy / Update-PROD-Stack (push) Failing after 18s
This commit is contained in:
@@ -54,9 +54,12 @@ jobs:
|
||||
# Read stack file content
|
||||
STACK_FILE_CONTENT=$(echo "$(<prod-compose.yml )")
|
||||
|
||||
# Prepare JSON payload
|
||||
JSON_PAYLOAD=$(jq -n --arg stackFileContent "$STACK_FILE_CONTENT" --argjson pullImage true \
|
||||
'{stackFileContent: $stackFileContent, pullImage: $pullImage}')
|
||||
# Parse .env file into JSON array format for Portainer
|
||||
ENV_VARS=$(cat .env | grep -v '^#' | grep -v '^$' | jq -R -s -c 'split("\n") | map(select(length > 0)) | map(split("=") | {name: .[0], value: (.[1:] | join("="))}) | map(select(.name != ""))')
|
||||
|
||||
# Prepare JSON payload with environment variables
|
||||
JSON_PAYLOAD=$(jq -n --arg stackFileContent "$STACK_FILE_CONTENT" --argjson pullImage true --argjson env "$ENV_VARS" \
|
||||
'{stackFileContent: $stackFileContent, pullImage: $pullImage, env: $env}')
|
||||
|
||||
echo "About to push the following JSON payload:"
|
||||
echo $JSON_PAYLOAD
|
||||
|
||||
Reference in New Issue
Block a user