Skip to content

Commit

Permalink
using tags instead of sha
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario-SO committed Dec 17, 2024
1 parent 93e6cfd commit fd9559f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ jobs:
echo "πŸ” Debug: Using stack name: $STACK_NAME"
echo "πŸ” Debug: Using compose file: $COMPOSE_FILE"
# Install Python dependencies
pip install PyYAML
# Create Python script to process the YAML
echo "πŸ“ Creating Python script..."
cat << EOF > process_compose.py
Expand All @@ -151,18 +148,18 @@ jobs:
for service in data["services"].values():
if "depends_on" in service:
service["depends_on"] = list(service["depends_on"].keys())
# Update image tags to use the current SHA
# Update image tags to use just the staging/prod tag without SHA
if "image" in service:
if ":staging" in service["image"] or ":prod" in service["image"]:
base_image = service["image"].split(":")[0]
service["image"] = f"{base_image}:{env_tag}-{sha}"
service["image"] = f"{base_image}:{env_tag}"
yaml.dump(data, sys.stdout, default_flow_style=False)
EOF
# Process the compose file and convert depends_on to list format
echo "πŸ”„ Processing compose file..."
docker compose -f $COMPOSE_FILE config | python3 process_compose.py > processed-compose.yml
docker-compose -f $COMPOSE_FILE config | python3 process_compose.py > processed-compose.yml
echo "πŸ“Š Processed file details:"
ls -l processed-compose.yml
Expand Down

0 comments on commit fd9559f

Please sign in to comment.