From 3d9b232d6a44bfdae2a9e379279d80f1071c4fb7 Mon Sep 17 00:00:00 2001 From: David Glick Date: Tue, 10 Sep 2024 15:29:17 -0700 Subject: [PATCH 1/4] Build both pnpm and yarn images --- .github/workflows/image-release.yml | 6 +- .github/workflows/nightly.yml | 55 -------------- .github/workflows/release.yml | 76 ++++++++++++++++--- .github/workflows/runnertest.yml | 4 +- Dockerfile.nightly | 38 ---------- pnpm/Dockerfile | 22 ++++++ pnpm/Dockerfile.builder | 36 +++++++++ Dockerfile.dev => pnpm/Dockerfile.dev | 2 +- pnpm/Dockerfile.prod | 40 ++++++++++ pnpm/pnpm-workspace.yaml | 10 +++ pnpm/volto.config.js | 7 ++ pyproject.toml | 2 +- Dockerfile => yarn/Dockerfile | 4 +- Dockerfile.builder => yarn/Dockerfile.builder | 0 yarn/Dockerfile.dev | 19 +++++ Dockerfile.prod => yarn/Dockerfile.prod | 2 +- {scripts => yarn/scripts}/helper.py | 0 17 files changed, 212 insertions(+), 111 deletions(-) delete mode 100644 .github/workflows/nightly.yml delete mode 100644 Dockerfile.nightly create mode 100644 pnpm/Dockerfile create mode 100644 pnpm/Dockerfile.builder rename Dockerfile.dev => pnpm/Dockerfile.dev (95%) create mode 100644 pnpm/Dockerfile.prod create mode 100644 pnpm/pnpm-workspace.yaml create mode 100644 pnpm/volto.config.js rename Dockerfile => yarn/Dockerfile (79%) rename Dockerfile.builder => yarn/Dockerfile.builder (100%) create mode 100644 yarn/Dockerfile.dev rename Dockerfile.prod => yarn/Dockerfile.prod (98%) rename {scripts => yarn/scripts}/helper.py (100%) diff --git a/.github/workflows/image-release.yml b/.github/workflows/image-release.yml index 7ebad66..479b7eb 100644 --- a/.github/workflows/image-release.yml +++ b/.github/workflows/image-release.yml @@ -23,6 +23,10 @@ on: required: false type: boolean default: false + suffix: + required: false + type: string + default: "" secrets: registry-username: required: true @@ -30,7 +34,6 @@ on: required: true jobs: - release: runs-on: [self-hosted, ARM64, stable] environment: DOCKER_HUB @@ -46,6 +49,7 @@ jobs: ${{ inputs.image-name }} flavor: | latest=false + suffix=${{ inputs.suffix }} tags: | type=ref,event=branch type=ref,event=pr diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 1bcd006..0000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Generate Nightly Image - -on: - workflow_dispatch: - -# schedule: -# - cron: '15 22 * * *' - -jobs: - - release: - runs-on: [self-hosted, ARM64, stable] - environment: DOCKER_HUB - - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - plone/plone-frontend - # update label with proper version number - labels: | - org.label-schema.docker.cmd=docker run -d -p 3000:3000 plone/plone-frontend:nightly - # generate Docker tags based on the following events/attributes - tags: | - type=raw,value=nightly - type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.4.1 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - platforms: linux/amd64,linux/arm64 - context: . - file: Dockerfile.nightly - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e02b3f..257004c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release new Docker image on: push: tags: - - 'v*' + - "v*" workflow_dispatch: env: @@ -12,7 +12,6 @@ env: IS_LATEST: false jobs: - meta: runs-on: ubuntu-latest outputs: @@ -33,7 +32,7 @@ jobs: echo "IS_LATEST=$IS_LATEST" >> $GITHUB_OUTPUT echo "VOLTO_VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT - builder-image: + pnpm-builder-image: needs: - meta uses: ./.github/workflows/image-release.yml @@ -47,7 +46,7 @@ jobs: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} registry-password: ${{ secrets.DOCKERHUB_TOKEN }} - prod-conf-image: + pnpm-prod-conf-image: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -62,7 +61,7 @@ jobs: needs: - meta - dev-image: + pnpm-dev-image: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -75,9 +74,9 @@ jobs: registry-password: ${{ secrets.DOCKERHUB_TOKEN }} needs: - meta - - builder-image + - pnpm-builder-image - plone-frontend: + pnpm-plone-frontend: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -90,5 +89,64 @@ jobs: registry-password: ${{ secrets.DOCKERHUB_TOKEN }} needs: - meta - - builder-image - - prod-conf-image + - pnpm-builder-image + - pnpm-prod-conf-image + + yarn-builder-image: + needs: + - meta + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-builder + dockerfile: Dockerfile.builder + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + + yarn-prod-conf-image: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-prod-config + dockerfile: Dockerfile.prod + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + + yarn-dev-image: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-dev + dockerfile: Dockerfile.dev + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + - yarn-builder-image + + yarn-plone-frontend: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: plone/plone-frontend + dockerfile: Dockerfile + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + - yarn-builder-image + - yarn-prod-conf-image diff --git a/.github/workflows/runnertest.yml b/.github/workflows/runnertest.yml index 6f864a7..ea6b036 100644 --- a/.github/workflows/runnertest.yml +++ b/.github/workflows/runnertest.yml @@ -4,13 +4,11 @@ on: workflow_dispatch: jobs: - release: runs-on: [self-hosted, ARM64, Linux, unstable] environment: DOCKER_HUB steps: - - name: Checkout uses: actions/checkout@v4 @@ -45,7 +43,7 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: . - file: Dockerfile.nightly + file: Dockerfile.builder push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile.nightly b/Dockerfile.nightly deleted file mode 100644 index e661bb6..0000000 --- a/Dockerfile.nightly +++ /dev/null @@ -1,38 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM node:18-slim as base -FROM base as builder - - -RUN < Date: Tue, 10 Sep 2024 15:43:40 -0700 Subject: [PATCH 2/4] mention the -yarn image in the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b310fe..68149a8 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ To check and report issues and contribute to Volto, See [plone/volto](https://gi ### Next major version -- `18` [(18.x/Dockerfile)](https://github.com/plone/plone-frontend/blob/18.x/Dockerfile) +- `18`, `18-yarn` [(18.x/Dockerfile)](https://github.com/plone/plone-frontend/blob/18.x/Dockerfile) ### Older tags From 4a3c2b68f3e73504658982b0fde5686adabf497c Mon Sep 17 00:00:00 2001 From: David Glick Date: Tue, 10 Sep 2024 15:47:30 -0700 Subject: [PATCH 3/4] unsaved file --- Makefile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Makefile b/Makefile index 9c1804b..ba49f09 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,6 @@ SHELL:=bash MAKEFLAGS+=--warn-undefined-variables MAKEFLAGS+=--no-builtin-rules -NIGHTLY_IMAGE_TAG=nightly - # We like colors # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects RED=`tput setaf 1` @@ -22,7 +20,6 @@ MAIN_IMAGE_NAME=plone/plone-frontend BASE_IMAGE_NAME=plone/frontend VOLTO_VERSION=$$(cat version.txt) IMAGE_TAG=${VOLTO_VERSION} -NIGHTLY_IMAGE_TAG=nightly # Code Quality CURRENT_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) @@ -60,7 +57,6 @@ lint: ## check code style .PHONY: show-image show-image: ## Print Version @echo "$(MAIN_IMAGE_NAME):$(IMAGE_TAG)" - @echo "$(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG)" @echo "$(BASE_IMAGE_NAME)-(builder|dev|prod-config):$(IMAGE_TAG)" .PHONY: image-builder @@ -83,11 +79,6 @@ image-main: ## Build main image @echo "Building $(MAIN_IMAGE_NAME):$(IMAGE_TAG)" @docker buildx build . --build-arg VOLTO_VERSION=${VOLTO_VERSION} -t $(MAIN_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --load -.PHONY: image-nightly -image-nightly: ## Build Docker Image Nightly - @echo "Building $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG)" - @docker build . -t $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG) -f Dockerfile.nightly - .PHONY: build-images build-images: ## Build Images @echo "Building $(BASE_IMAGE_NAME)-(builder|dev|prod):$(IMAGE_TAG) images" From 36832a1b3d3d124928dd36c38ac97ae7b9326e9b Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Fri, 13 Sep 2024 18:29:45 +0200 Subject: [PATCH 4/4] Use a43 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index d3d34f4..4d48f8c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -18.0.0-alpha.42 +18.0.0-alpha.43