Skip to content

Commit

Permalink
Fix minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydrogers committed Oct 5, 2024
1 parent 9f1b50f commit 12397a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/service_docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
PYTHON_VERSION=${{ matrix.python_version }}
BASE_OS_VERSION=${{ matrix.base_os }}
ANSIBLE_VARIATION=${{ matrix.ansible_variation }}
ANSIBLE_VERSION=${{ matrix.ansible_version }}
ANSIBLE_VERSION=${{ env.ANSIBLE_PATCH_VERSION }}
PACKAGE_DEPENDENCIES=${{ env.PACKAGE_DEPENDENCIES }}
platforms: |
linux/amd64
Expand Down
24 changes: 22 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ lookup_pypi_version() {
fi
}


lookup_and_save_ansible_version() {
local variation=$1
local version=$2

local ansible_patch_version=$(lookup_pypi_version "$variation" "$version")
if [ $? -ne 0 ]; then
echo_color_message red "Failed to lookup Ansible version"
exit 1
fi

echo_color_message green "Looked up Ansible version: ${ansible_patch_version}"
save_to_github_env "ANSIBLE_PATCH_VERSION" "${ansible_patch_version}"

echo "${ansible_patch_version}"
}

# Update generate_tags function
generate_tags() {
local tags=()
Expand Down Expand Up @@ -288,8 +305,8 @@ build_docker_image() {
local os_family=$(get_os_family)
local package_dependencies=$(get_package_dependencies "$os_family")

# Get the full patch version
local full_ansible_version=$(lookup_pypi_version "$ANSIBLE_VARIATION" "$ANSIBLE_VERSION")
# Get the full patch version and save it to GITHUB_ENV
local full_ansible_version=$(lookup_and_save_ansible_version "$ANSIBLE_VARIATION" "$ANSIBLE_VERSION")

build_args=(
--build-arg ANSIBLE_VARIATION="$ANSIBLE_VARIATION"
Expand Down Expand Up @@ -523,6 +540,9 @@ print_tags() {
# Main execution
if [ "$PRINT_TAGS_ONLY" = true ]; then
print_tags

# Lookup and save Ansible version even when just printing tags
lookup_and_save_ansible_version "$ANSIBLE_VARIATION" "$ANSIBLE_VERSION"
else
build_docker_image
fi

0 comments on commit 12397a2

Please sign in to comment.