diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f90462e..7e77428 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build & Publish Docker Images on: + pull_request: push: branches: [ main ] workflow_dispatch: {} @@ -28,33 +29,35 @@ jobs: shell: bash run: | # Define Gradle versions per JDK in compact arrays to avoid a huge YAML matrix + # Keep only major tag and latest patch version in that major. Gradle does not republish patch versions. JDK25=( 9 9.1.0 ) JDK21=( - 8 8.6 8.7 8.8 8.9 8.10 8.10.1 8.10.2 8.11.0 8.11.1 8.12.0 8.12.1 8.13 8.14.0 8.14.1 8.14.2 8.14.3 9 9.0.0 9.1.0 + 8 8.14.3 9 9.1.0 ) JDK17=( - 8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 8.10.1 8.10.2 8.11.0 8.11.1 8.12.0 8.12.1 8.13 8.14.0 8.14.1 8.14.2 8.14.3 9 9.0.0 9.1.0 + 8 8.14.3 9 9.1.0 ) JDK11=( - 8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 8.10.1 8.10.2 8.11.0 8.11.1 8.12.0 8.12.1 8.13 8.14.0 8.14.1 8.14.2 8.14.3 + 8 8.14.3 ) JDK8=( - 8.14.3 + 8 8.14.3 ) VERSIONS=() - for v in "${JDK25[@]}"; do VERSIONS+=("\"${v}-jdk25\""); done - for v in "${JDK21[@]}"; do VERSIONS+=("\"${v}-jdk21\""); done - for v in "${JDK17[@]}"; do VERSIONS+=("\"${v}-jdk17\""); done - for v in "${JDK11[@]}"; do VERSIONS+=("\"${v}-jdk11\""); done - for v in "${JDK8[@]}"; do VERSIONS+=("\"${v}-jdk8\""); done + for v in "${JDK25[@]}"; do VERSIONS+=("${v}-jdk25"); done + for v in "${JDK21[@]}"; do VERSIONS+=("${v}-jdk21"); done + for v in "${JDK17[@]}"; do VERSIONS+=("${v}-jdk17"); done + for v in "${JDK11[@]}"; do VERSIONS+=("${v}-jdk11"); done + for v in "${JDK8[@]}"; do VERSIONS+=("${v}-jdk8"); done - JSON=$(printf '%s\n' "${VERSIONS[@]}" | jq -s .) + JSON=$(printf '%s\n' "${VERSIONS[@]}" | jq -R -s -c 'split("\n")[:-1]') echo "matrix={\"version\":$JSON}" >> "$GITHUB_OUTPUT" build-and-push: + if: github.ref == 'refs/heads/main' name: ${{ matrix.version }} runs-on: ubuntu-latest env: @@ -86,7 +89,7 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 -# push: true + push: true build-args: | VERSION=${{ matrix.version }} tags: | diff --git a/Dockerfile b/Dockerfile index 03a6e84..c89ee50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ ARG VERSION=latest FROM gradle:${VERSION} +LABEL maintainer="Bitweb " + ARG TARGETARCH RUN if [ "$TARGETARCH" = "arm64" ]; then \ curl -sSL "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \ else \ curl -sSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \ fi && \ - unzip awscliv2.zip && \ + unzip -q awscliv2.zip && \ ./aws/install && \ rm awscliv2.zip && \ rm -rf aws/ && \ diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..c9e2978 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,10 @@ +View license information for [Gradle](https://gradle.org/license/) and [aws-cli v2](https://github.com/aws/aws-cli/blob/develop/LICENSE.txt). + +As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc +from the base distribution, along with any direct or indirect dependencies of the primary software being contained). + +As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies +with any relevant licenses for all software contained within. + +THIS PROJECT IS NOT ENDORSED IN ANY WAY BY AMAZON OR GRADLE. +ALL TRADEMARKS AND COPYRIGHT BELONG TO THEIR RESPECTIVE OWNERS. diff --git a/README.md b/README.md index 3539509..72d7504 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,15 @@ elsewhere as well. `amd64` and `arm64` architectures are supported at this moment. -Maintained by: [Bitweb OÜ](https://bitweb.ee). Updates are published every Sunday. +Maintained by: [Bitweb OÜ](https://bitweb.ee). # Supported tags -Only Gradle versions supported by [Gradle](https://endoflife.date/gradle) are published. +Only Gradle versions actively supported by [Gradle](https://endoflife.date/gradle) are published. Supported Java versions: 8, 11, 17, 21, 25. -If the version you need is not listed, or you need different architecture, please contact Bitweb at [tech@bitweb.ee](mailto:tech@bitweb.ee). +If the version you need is not available, or you need different architecture, please contact Bitweb at [tech@bitweb.ee](mailto:tech@bitweb.ee). # Usage in Bitbucket Pipelines @@ -36,37 +36,16 @@ It's recommended to specify only major version, this way you'll stay up-to-date ## Deployment -Deployment is done automatically to Docker Hub from master branch. Updates are automatically done every Sunday. +Deployment is done automatically to Docker Hub from main branch. Updates are made when new Gradle versions are published. New Gradle/JDK versions need to be added manually. -Tags with patch versions will not be tolerated and provided. - ## Adding a new version (tag) -1. Create a new Pipeline step (in `bitbcuket-pipelines.yml`), that extends base step and specifies deployment name and -description. Deployment name must follow the following convention: _{gradle-version}-{jdk-version}_ Dots are not -allowed, so remove them: 7.3-jdk11 -> 73-jdk11 -2. Add the step to master list -3. Update readme -4. Create the deployment environment in production [Bitbucket Pipelines](https://bitbucket.org/bitwebou/infra-docker-gradle-awscli/admin/pipelines/deployment-settings) -5. Add deployment variable with name _VERSION_ and value as tag name from base Gradle image -6. Push and validate -7. Update README in Docker Hub. Skip _Deployment_ and _Adding a new version_ headings. +1. Add new version to respective JDK arrays in [build workflow](https://github.com/BitWeb/docker-gradle-awscli/blob/main/.github/workflows/build.yml) +2. Update readme when needed (new Gradle major version or JDK) +3. Create a PR with changes # License -View license information for [Gradle](https://gradle.org/license/) and [aws-cli v2](https://github.com/aws/aws-cli/blob/develop/LICENSE.txt). - -As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc -from the base distribution, along with any direct or indirect dependencies of the primary software being contained). - -As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies -with any relevant licenses for all software contained within. - -THIS PROJECT IS NOT ENDORSED IN ANY WAY BY AMAZON OR GRADLE. -ALL TRADEMARKS AND COPYRIGHT BELONG TO THEIR RESPECTIVE OWNERS. - -# TODO - -* `latest` tag (needs separating gradle image and our image tag in deployment) +See [LICENSE.MD](https://github.com/BitWeb/docker-gradle-awscli/blob/main/LICENSE.MD)