Skip to content

Commit

Permalink
if-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
yordanovsstoyan committed Aug 14, 2024
1 parent 331f5c3 commit 08f9ec8
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions actions/java-gradle-build-jib/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,26 @@ runs:
- name: Build Docker image
run: |
if [ "${{ github.ref_type }}" != "tag" ]; then
./gradlew ${{ inputs.subproject && format('{0}:', inputs.subproject) || '' }}jib \
--info --stacktrace \
--image=${{ inputs.image-name }} \
-Djib.from.platforms=${{ inputs.platforms }} \
${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \
${{ inputs.class && format('-Djib.container.mainClass={0}', inputs.class) || '' }} \
-Djib.to.image=${{ inputs.full-image-name }}$(echo ${{ steps.meta.outputs.tags }} | grep 'pipeline' | sed 's/.*\(:.*\)/\1/') \
-Djib.to.tags=$(echo "${{ steps.meta.outputs.tags }}" | tr ',' '\n' | sed 's/.*://') \
${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }} \
${{ inputs.allow-insecure-registries == 'true' && '-Djib.allowInsecureRegistries=true' || '' }}
./gradlew ${{ inputs.subproject && format('{0}:', inputs.subproject) || '' }}jib \
--info --stacktrace \
--image=${{ inputs.image-name }} \
-Djib.from.platforms=${{ inputs.platforms }} \
${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \
${{ inputs.class && format('-Djib.container.mainClass={0}', inputs.class) || '' }} \
-Djib.to.image=${{ inputs.full-image-name }}$(echo ${{ steps.meta.outputs.tags }} | grep 'pipeline' | sed 's/.*\(:.*\)/\1/') \
${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }} \
${{ inputs.allow-insecure-registries == 'true' && '-Djib.allowInsecureRegistries=true' || '' }}
else
./gradlew ${{ inputs.subproject && format('{0}:', inputs.subproject) || '' }}jib \
--info --stacktrace \
--image=${{ inputs.image-name }} \
-Djib.from.platforms=${{ inputs.platforms }} \
${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \
${{ inputs.class && format('-Djib.container.mainClass={0}', inputs.class) || '' }} \
-Djib.to.image=${{ inputs.full-image-name }} \
-Djib.to.tags=${{ steps.meta.outputs.version } \
${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }} \
${{ inputs.allow-insecure-registries == 'true' && '-Djib.allowInsecureRegistries=true' || '' }}
--info --stacktrace \
--image=${{ inputs.image-name }} \
-Djib.from.platforms=${{ inputs.platforms }} \
${{ inputs.jib-from-image && format('-Djib.from.image={0}', inputs.jib-from-image) || '' }} \
${{ inputs.class && format('-Djib.container.mainClass={0}', inputs.class) || '' }} \
-Djib.to.image=${{ inputs.full-image-name }} \
-Djib.to.tags=${{ steps.meta.outputs.version }} \
${{ inputs.gradle-refresh-dependencies == 'true' && '--refresh-dependencies' || '' }} \
${{ inputs.allow-insecure-registries == 'true' && '-Djib.allowInsecureRegistries=true' || '' }}
fi
shell: bash
working-directory: ${{ inputs.working-directory }}

0 comments on commit 08f9ec8

Please sign in to comment.