Skip to content

Commit

Permalink
mimick operator-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed Apr 8, 2024
1 parent 55cab0b commit da65d2e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/publish_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
charm_working_directory: "./charm"
charmcraft_ref: feat-12f-django
charmcraft_repository: weiiwang01/charmcraft
paas-app-charmer-oci-name: django-app-image
tag_prefix:
working_directory: "./"

Expand Down Expand Up @@ -292,14 +293,15 @@ jobs:
echo images: -"${images[@]}"-
for image in "${images[@]}"; do
resource_name=$(echo $image | awk -F '/' '{print $NF}' | cut -d ':' -f 1)
# This is for paas-app-charmer for Django, as the main image name is named "django-app-image" and
# should match the main rockcraft.yaml.
if [[ ${resource_name} == ${CHARM_NAME} ]] && [[ " ${resources[@]} " =~ " django-app-image " ]]; then
resource_name=django-app
if [[ "${{ paas-app-charmer-oci-name }}" != "" ]]; then
# This is for paas-app-charmer . The main image name (resource oci in charmcraft.yaml) is
# defined with the env variable paas-app-charmer-oci-name, and corresponds to the main
# image in rockcraft.yaml.
resource_name="{{ paas-app-charmer-oci-name }}"
else
resource_name=$(echo $image | awk -F '/' '{print $NF}' | cut -d ':' -f 1)-image
fi
resource=${resource_name}-image
echo resource: -"${resource}"-
if [[ " ${resources[@]} " =~ " $resource " ]]; then
docker pull $image
image_id=$(docker images $image --format "{{.ID}}")
Expand Down

0 comments on commit da65d2e

Please sign in to comment.