Vanilla Base Images #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Vanilla Base Images | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| image: | |
| description: Image to build | |
| required: true | |
| default: all | |
| type: choice | |
| options: | |
| - all | |
| - hive-3.1.3 | |
| - hive-4.2.0 | |
| - standalone-metastore-4.2.0 | |
| image_registry: | |
| description: Image registry/repository prefix | |
| required: true | |
| default: ghcr.io/openprojectx | |
| type: string | |
| push: | |
| description: Push images after build | |
| required: true | |
| default: false | |
| type: boolean | |
| jobs: | |
| build: | |
| if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[Gradle Release Plugin]') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| if: ${{ inputs.push && startsWith(inputs.image_registry, 'ghcr.io/') }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build vanilla image | |
| if: ${{ ! inputs.push }} | |
| run: | | |
| set -eux | |
| case "${{ inputs.image }}" in | |
| all) task=":image:dockerBuildVanillaAll" ;; | |
| hive-3.1.3) task=":image:dockerBuildVanillaHive313" ;; | |
| hive-4.2.0) task=":image:dockerBuildVanillaHive420" ;; | |
| standalone-metastore-4.2.0) task=":image:dockerBuildVanillaStandaloneMetastore420" ;; | |
| *) echo "Unknown image: ${{ inputs.image }}" >&2; exit 1 ;; | |
| esac | |
| ./gradlew --no-configuration-cache "$task" -PimageRegistry="${{ inputs.image_registry }}" | |
| - name: Push vanilla image | |
| if: ${{ inputs.push }} | |
| run: | | |
| set -eux | |
| case "${{ inputs.image }}" in | |
| all) task=":image:dockerPushVanillaAll" ;; | |
| hive-3.1.3) task=":image:dockerPushVanillaHive313" ;; | |
| hive-4.2.0) task=":image:dockerPushVanillaHive420" ;; | |
| standalone-metastore-4.2.0) task=":image:dockerPushVanillaStandaloneMetastore420" ;; | |
| *) echo "Unknown image: ${{ inputs.image }}" >&2; exit 1 ;; | |
| esac | |
| ./gradlew --no-configuration-cache "$task" -PimageRegistry="${{ inputs.image_registry }}" |