From b0b09b132cf57a4ce95f72d924a2940605b3eb16 Mon Sep 17 00:00:00 2001 From: yordanovsstoyan Date: Tue, 11 Jun 2024 14:45:11 +0300 Subject: [PATCH] test --- .../README.md | 4 - .../action.yaml | 103 ------------------ .../README.md | 53 +++++++++ 3 files changed, 53 insertions(+), 107 deletions(-) delete mode 100644 actions/java-gradle-build-jib-multi-plaftorm/README.md delete mode 100644 actions/java-gradle-build-jib-multi-plaftorm/action.yaml create mode 100644 docs/actions/java-gradle-build-push-jib-multi-plaftorm/README.md diff --git a/actions/java-gradle-build-jib-multi-plaftorm/README.md b/actions/java-gradle-build-jib-multi-plaftorm/README.md deleted file mode 100644 index d2242dd18..000000000 --- a/actions/java-gradle-build-jib-multi-plaftorm/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# java-gradle-build-jib - -- [Description](https://github.com/bakdata/ci-templates/tree/main/docs/actions/java-gradle-build-jib) -- [References](https://github.com/bakdata/ci-templates/tree/main/docs/actions/java-gradle-build-jib) diff --git a/actions/java-gradle-build-jib-multi-plaftorm/action.yaml b/actions/java-gradle-build-jib-multi-plaftorm/action.yaml deleted file mode 100644 index 1d0b66ee9..000000000 --- a/actions/java-gradle-build-jib-multi-plaftorm/action.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: "Build tarball image" -description: "Build tarball image using Gradle" - -inputs: - image-tag: - description: "Tag of Jib Image." - required: false - default: "" - registry-password: - description: "Password of registry." - required: false - default: "" - full-image-name: - description: "Full name of image." - required: false - default: "" - image-artifact-name: - description: "Artifact name to upload tarball image, see https://github.com/actions/upload-artifact" - required: false - default: "image-artifact" - image-name: - description: "Name of Docker image." - required: false - default: "${{ github.event.repository.name }}" - java-distribution: - description: "Java distribution to be installed. (Default is microsoft)" - required: false - default: "microsoft" - java-version: - description: "Java version to be installed. (Default is 11)" - required: false - default: "11" - gradle-version: - description: "Gradle version to be installed. (Default is wrapper)" - required: false - default: "wrapper" - gradle-cache: - description: "Whether Gradle caching is enabled or not. (Default is true)" - required: false - default: "true" - gradle-cache-read-only: - description: "Whether Gradle caching should be read-only. By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches." - required: false - default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} - gradle-refresh-dependencies: - description: "Whether Gradle should refresh dependencies. (Default is false)" - required: false - default: "false" - working-directory: - description: "Working directory of your Gradle artifacts. (Default is .)" - required: false - default: "." - download-lfs-files: - description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" - required: false - default: "false" - subproject: - description: "The Gradle subproject for which the tarball image should be built (If not specified, a tarball image for the root project will be built)" - required: false - jib-from-image: - description: "The Jib base image to use" - required: false -runs: - using: "composite" - steps: - - name: Check out repository - uses: bakdata/ci-templates/actions/checkout@1.32.0 - with: - lfs: ${{ inputs.download-lfs-files }} - - - name: Set up Gradle with version ${{ inputs.gradle-version }} - uses: bakdata/ci-templates/actions/java-gradle-setup@1.42.0 - with: - java-distribution: ${{ inputs.java-distribution }} - java-version: ${{ inputs.java-version }} - gradle-version: ${{ inputs.gradle-version }} - gradle-cache: ${{ inputs.gradle-cache }} - gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }} - - - name: Build Docker image - run: | - ./gradlew ${{ inputs.subproject && format('{0}:', inputs.subproject) || '' }}jib \ - --info --stacktrace \ - --image=${{ inputs.image-name }} \ - ${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \ - -Djib.from.platforms=linux/arm64,linux/amd64 \ - -DsendCredentialsOverHttp \ - -Djib.allowInsecureRegistries=true \ - -Djib.to.image=${{ inputs.full-image-name }}:${{ inputs.image-tag }} \ - -Djib.to.tags=${{ inputs.image-tag }} \ - -Djib.to.auth.username=AWS \ - -Djib.to.auth.password=${{ inputs.registry-password }} \ - -x test \ - ${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }} - shell: bash - working-directory: ${{ inputs.working-directory }} - - - name: Upload tarball image artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.image-artifact-name }} - path: ${{ inputs.subproject && format('{0}/', inputs.subproject) || '' }}build/jib-image.tar - retention-days: 1 diff --git a/docs/actions/java-gradle-build-push-jib-multi-plaftorm/README.md b/docs/actions/java-gradle-build-push-jib-multi-plaftorm/README.md new file mode 100644 index 000000000..81ad803e7 --- /dev/null +++ b/docs/actions/java-gradle-build-push-jib-multi-plaftorm/README.md @@ -0,0 +1,53 @@ +# Description java-gradle-build-push-jib-multi-platform composite action + +This action builds and pushes a multi-plaform image using [Jib Gradle](https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin) to a private image registry. + +## Usage + +```yaml +steps: + - name: Build multi-plaform image + uses: bakdata/ci-templates/actions/java-gradle-build-push-jib-multi-platform@main + with: + full-image-name: "registry/image-name" # (Required) + registry-password: "registry-password" # (Required) + image-tag: "tag" # (Optional) + image-artifact-name: "image-artifact" # (Optional) + java-distribution: "microsoft" # (Optional) + java-version: "11" # (Optional) + gradle-version: "wrapper" # (Optional) + working-directory: "." # (Optional) +``` + +## References + +### Inputs + + + +| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | +| --------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| download-lfs-files | string | false | `"false"` | Whether the Git checkout action should resolve LFS files or not. (Default is false) | +| gradle-cache | string | false | `"true"` | Whether Gradle caching is enabled or not. (Default is true) | +| gradle-cache-read-only | string | false | `"${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }}"` | Whether Gradle caching should be read-only. By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches. | +| gradle-refresh-dependencies | string | false | `"false"` | Whether Gradle should refresh dependencies. (Default is false) | +| gradle-version | string | false | `"wrapper"` | Gradle version to be installed. (Default is wrapper) | +| image-artifact-name | string | false | `"image-artifact"` | Artifact name to upload tarball image, see https://github.com/actions/upload-artifact | +| image-name | string | false | `"${{ github.event.repository.name }}"` | Name of Docker image. | +| java-distribution | string | false | `"microsoft"` | Java distribution to be installed. (Default is microsoft) | +| java-version | string | false | `"11"` | Java version to be installed. (Default is 11) | +| jib-from-image | string | false | | The Jib base image to use | +| subproject | string | false | | The Gradle subproject for which the tarball image should be built (If not specified, a tarball image for the root project will be built) | +| working-directory | string | false | `"."` | Working directory of your Gradle artifacts. (Default is .) | + + + +### Outputs + + + +No outputs. + + + +### Secrets