This is an automated email from the ASF dual-hosted git repository. danwatford pushed a commit to branch experimental-docker in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/experimental-docker by this push: new ede57fc5e6 Added: Experimenting with adding plugins to a container image (OFBIZ-12757) ede57fc5e6 is described below commit ede57fc5e6d2e52f85cbcf9ad8a075c75435477d Author: Daniel Watford <dan...@watfordconsulting.com> AuthorDate: Sat Mar 4 16:23:28 2023 +0000 Added: Experimenting with adding plugins to a container image (OFBIZ-12757) --- .github/workflows/docker-image.yaml | 129 +++++++++++++++++++++++------------- 1 file changed, 84 insertions(+), 45 deletions(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 8e86839a18..2d23ef59c5 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -26,54 +26,93 @@ jobs: name: Build and push OFBiz docker container images runs-on: ubuntu-latest steps: - - name: Check out OFBiz sources - uses: actions/checkout@v3 + - name: Check out OFBiz sources + uses: actions/checkout@v3 - - name: Log in to the Container registry - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Determine metadata (tags, labels) for Docker runtime build - id: runtimemeta - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 - with: - images: ghcr.io/apache/ofbiz - tags: | - # Extract container tag from git tag. - type=match,pattern=release(.*),group=1 - # Build container tag based on branch name and string '-branch-snapshot' - type=ref,event=branch,suffix=-branch-snapshot,priority=650 - # Construct container tag based on branch name, string 'branch' and the short format of the commit SHA. - type=ref,event=branch,suffix=-branch-{{sha}},priority=600 + ############################################################################ + # Build and push a container image of the OFBiz Framework without any data loaded. + - name: Determine metadata (tags, labels) for Docker runtime build + id: runtimemeta + uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 + with: + images: ghcr.io/apache/ofbiz + tags: | + # Extract container tag from git tag. + type=match,pattern=release(.*),group=1 + # Build container tag based on branch name and string '-branch-snapshot' + type=ref,event=branch,suffix=-branch-snapshot,priority=650 + # Construct container tag based on branch name, string 'branch' and the short format of the commit SHA. + type=ref,event=branch,suffix=-branch-{{sha}},priority=600 - - name: Build and push runtime docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: . - target: runtime - push: true - tags: ${{ steps.runtimemeta.outputs.tags }} - labels: ${{ steps.runtimemeta.outputs.labels }} + - name: Build and push runtime docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + target: runtime + push: true + tags: ${{ steps.runtimemeta.outputs.tags }} + labels: ${{ steps.runtimemeta.outputs.labels }} - - name: Determine metadata (tags, labels) for Docker demo-preload build - id: demometa - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 - with: - images: ghcr.io/apache/ofbiz - tags: | - type=match,pattern=release(.*),group=1,suffix=-preloaddemo - type=ref,event=branch,suffix=-branch-preloaddemo-snapshot,priority=650 - type=ref,event=branch,suffix=-branch-preloaddemo-{{sha}},priority=600 + ############################################################################ + # Build and push a container image of the OFBiz Framework preloaded with demo data + - name: Determine metadata (tags, labels) for Docker demo-preload build + id: demometa + uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 + with: + images: ghcr.io/apache/ofbiz + tags: | + type=match,pattern=release(.*),group=1,suffix=-preloaddemo + type=ref,event=branch,suffix=-branch-preloaddemo-snapshot,priority=650 + type=ref,event=branch,suffix=-branch-preloaddemo-{{sha}},priority=600 - - name: Build and push demo docker image - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: . - target: demo - push: true - tags: ${{ steps.demometa.outputs.tags }} - labels: ${{ steps.demometa.outputs.labels }} + - name: Build and push demo docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + target: demo + push: true + tags: ${{ steps.demometa.outputs.tags }} + labels: ${{ steps.demometa.outputs.labels }} + ############################################################################ + # Build and push a container image of the OFBiz Framework plus Plugins, + # without any data loaded. + # We need to use gradle to download sources as plugins might include an install + # task in their own build.gradle files. If the project drops support for plugins' + # install tasks then we can replace the JDK and gradle related steps below with + # a git checkout from the https://github.com/apache/ofbiz-plugins repository. + - name: Set up JDK 17 + uses: actions/setup-java@v3.6.0 + with: + java-version: 17 + distribution: temurin + cache: 'gradle' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew pullAllPluginsSource + - name: Determine metadata (tags, labels) for Docker framework with plugins build + id: pluginsmeta + uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 + with: + images: ghcr.io/apache/ofbiz + tags: | + type=match,pattern=release(.*),group=1,suffix=-plugins + type=ref,event=branch,suffix=-branch-plugins-snapshot,priority=650 + type=ref,event=branch,suffix=-branch-plugins-{{sha}},priority=600 + + - name: Build and push framework with plugins docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + target: runtime + push: true + tags: ${{ steps.pluginsmeta.outputs.tags }} + labels: ${{ steps.pluginsmeta.outputs.labels }}