Updated pipeline
This commit is contained in:
@@ -25,7 +25,11 @@ echo "Injecting secrets..."
|
||||
echo " Deploy path: $DEPLOY_PATH"
|
||||
echo " Secrets dir: $SECRETS_DIR"
|
||||
|
||||
# Create secrets directory if it doesn't exist
|
||||
# Clean up any incorrectly created directories and create secrets directory
|
||||
if [ -e "$SECRETS_DIR" ] && [ ! -d "$SECRETS_DIR" ]; then
|
||||
echo " Removing invalid secrets path..."
|
||||
rm -rf "$SECRETS_DIR"
|
||||
fi
|
||||
mkdir -p "$SECRETS_DIR"
|
||||
chmod 700 "$SECRETS_DIR"
|
||||
|
||||
@@ -48,6 +52,11 @@ inject_secret() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Remove if exists as directory (cleanup from bad previous runs)
|
||||
if [ -d "$target_path" ]; then
|
||||
rm -rf "$target_path"
|
||||
fi
|
||||
|
||||
# Copy the secret file
|
||||
cp "$source_path" "$target_path"
|
||||
chmod 600 "$target_path"
|
||||
|
||||
Reference in New Issue
Block a user