Skip to content

Commit

Permalink
DAT-18282 DevOps :: Docker Issue in create-release.yml (#326)
Browse files Browse the repository at this point in the history
* ✨ (create-release.yml): Update LPM_VERSION from "0.2.6" to "0.2.7" in the workflow file to use the latest version of the tool. Also, commented out the steps related to updating the official Docker repository as they are not needed at the moment.

* ⬆️ (Dockerfile): Upgrade LPM_SHA256 value to match the new checksum for improved security and integrity

* 📝 (create-release.yml): update create-release workflow configuration to optimize performance and readability

🔧 (create-release.yml): Comment out unnecessary actions/checkout and actions/setup-java steps to improve workflow readability and reduce unnecessary steps.

📝 (workflow.yml): update script to extract major.minor version and print full version for debugging purposes

* 🔧 (create-release.yml): Update references to use the output from the 'update-dockerfiles' job for the liquibase version to ensure consistency and accuracy in the Docker image tags and versioning.

* 🔧 (create-release.yml): update MAJOR_MINOR variable to use liquibaseVersion from update-dockerfiles job output for consistency and accuracy

* 🔧 (create-release.yml): Update Dockerfile to use uppercase variable names for consistency and improve readability
🔧 (create-release.yml): Update Dockerfile to support different architectures for Docker image building and pushing

🔧 (create-release.yml): update workflow to use uppercase letters for environment variables for consistency and readability
🔧 (create-release.yml): update workflow to use correct indentation for job steps for better readability and maintainability
  • Loading branch information
jandroav authored Jul 26, 2024
1 parent b293d09 commit 6903fb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

update-dockerfiles:
env:
LPM_VERSION: "0.2.6"
LPM_VERSION: "0.2.7"
name: "Update Dockerfiles"
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -155,6 +155,7 @@ jobs:

update-official-repo:
name: "Update Official Docker Repo"
needs: update-dockerfiles
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -163,8 +164,10 @@ jobs:
- name: Extract major.minor version
id: extract_version
run: |
VERSION="${{ inputs.liquibaseVersion }}"
VERSION="${{ needs.update-dockerfiles.outputs.liquibaseVersion }}"
echo "MAJOR_MINOR=${VERSION%.*}" >> $GITHUB_ENV
echo "VERSION: $VERSION"
echo "MAJOR_MINOR: ${VERSION%.*}"
- name: Check out liquibase/official-images
uses: actions/checkout@v4
Expand All @@ -179,12 +182,12 @@ jobs:
echo "Architectures: arm64v8, amd64" >> library/liquibase
echo "GitRepo: https://github.com/liquibase/docker.git" >> library/liquibase
echo "" >> library/liquibase
echo "Tags: ${{ env.MAJOR_MINOR }}, ${{ inputs.liquibaseVersion }}, latest" >> library/liquibase
echo "Tags: ${{ env.MAJOR_MINOR }}, ${{ needs.update-dockerfiles.outputs.liquibaseVersion }}, latest" >> library/liquibase
echo "GitFetch: refs/heads/main" >> library/liquibase
echo "GitCommit: ${{ github.sha }}" >> library/liquibase
echo "File: Dockerfile" >> library/liquibase
echo "" >> library/liquibase
echo "Tags: ${{ env.MAJOR_MINOR }}-alpine, ${{ inputs.liquibaseVersion }}-alpine, alpine" >> library/liquibase
echo "Tags: ${{ env.MAJOR_MINOR }}-alpine, ${{ needs.update-dockerfiles.outputs.liquibaseVersion }}-alpine, alpine" >> library/liquibase
echo "GitFetch: refs/heads/main" >> library/liquibase
echo "GitCommit: ${{ github.sha }}" >> library/liquibase
echo "File: Dockerfile.alpine" >> library/liquibase
Expand All @@ -195,7 +198,7 @@ jobs:
else
git config user.name "liquibot"
git config user.email "[email protected]"
git commit -m "Update library/liquibase to ${{ inputs.liquibaseVersion }}"
git commit -m "Update library/liquibase to ${{ needs.update-dockerfiles.outputs.liquibaseVersion }}"
git push https://liquibot:[email protected]/liquibase/official-images.git
fi
Expand All @@ -208,7 +211,7 @@ jobs:
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/docker-library/official-images/pulls \
-d '{
"title": "Update library/liquibase to ${{ inputs.liquibaseVersion }}",
"title": "Update library/liquibase to ${{ needs.update-dockerfiles.outputs.liquibaseVersion }}",
"body": "Update library/liquibase with latest commit and version",
"head": "liquibase:master",
"base": "master"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN wget -q -O liquibase-${LIQUIBASE_VERSION}.tar.gz "https://github.com/liquiba
liquibase --version

ARG LPM_VERSION=0.2.7
ARG LPM_SHA256=0e1df6b8daf9d53a2d1d90fa8e48abbcbb8e885d249de7a09879a3a0276bebdf
ARG LPM_SHA256=e831120c566c76a427c6d3489cd62d5447322444399393e3ef304db0c036c4a1
ARG LPM_SHA256_ARM=720afb6bafb987ab502b86682f410d0e19da45fdf0119d947ed7bfa4e6a02665

# Download and Install lpm
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN set -x && \
liquibase --version

ARG LPM_VERSION=0.2.7
ARG LPM_SHA256=0e1df6b8daf9d53a2d1d90fa8e48abbcbb8e885d249de7a09879a3a0276bebdf
ARG LPM_SHA256=e831120c566c76a427c6d3489cd62d5447322444399393e3ef304db0c036c4a1
ARG LPM_SHA256_ARM=720afb6bafb987ab502b86682f410d0e19da45fdf0119d947ed7bfa4e6a02665

# Download and Install lpm
Expand Down

0 comments on commit 6903fb3

Please sign in to comment.