From e694318397bec8b0792d26375169d21104594cba Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Wed, 20 Nov 2024 15:52:18 +0300 Subject: [PATCH 01/14] Add push triggers for branches --- .github/workflows/ci-oci-docker-install.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci-oci-docker-install.yml b/.github/workflows/ci-oci-docker-install.yml index 659db31b46..b3407b4384 100644 --- a/.github/workflows/ci-oci-docker-install.yml +++ b/.github/workflows/ci-oci-docker-install.yml @@ -6,6 +6,11 @@ on: paths: - '.github/workflows/ci-oci-docker-install.yml' - 'install/OneClickInstall/install-Docker.sh' + push: + branches: + - master + - 'release/**' + - 'hotfix/**' workflow_dispatch: inputs: offline: From 74fc0f5c4c71008c3afbb2b854c5052bf67d2461 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 09:49:57 +0300 Subject: [PATCH 02/14] Add trigger for changes in entrypoint files --- .github/workflows/config-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/config-build.yml b/.github/workflows/config-build.yml index c44c5eebc5..791ed67162 100644 --- a/.github/workflows/config-build.yml +++ b/.github/workflows/config-build.yml @@ -9,6 +9,7 @@ on: paths: - 'config/**' - 'install/docker/Dockerfile.app' + - 'install/docker/*entrypoint*.*' workflow_dispatch: jobs: From 0b98a897f55c0ee5bd701269b575ddc021c6451e Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 10:36:50 +0300 Subject: [PATCH 03/14] Add test scripts for OCI Docker after build --- .github/workflows/main-build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index db31fe585f..aa4e2755c4 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -74,6 +74,17 @@ jobs: echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT" shell: bash + - name: Test OCI docker scripts + run: | + wget https://download.onlyoffice.com/docspace/docspace-enterprise-install.sh + sed '/bash install-Docker.sh/i sed -i "1i set -x" install-Docker.sh' -i docspace-enterprise-install.sh + sed '/bash install-Docker.sh/i sed -i "/docker-compose.*up -d/ s/$/ --quiet-pull/" install-Docker.sh' -i docspace-enterprise-install.sh + sudo bash docspace-enterprise-install.sh docker -docsi onlyoffice/documentserver-ee -skiphc true -noni true $([ ${{ matrix.branch }} != "master" ] && echo "-gb ${{ matrix.branch }} -s 4testing-") || exit $? + + echo -n "Waiting for all containers to start..." + timeout 300 bash -c 'while docker ps | grep -q "starting"; do sleep 5; done' && echo "OK" || echo "container_status=timeout" >> $GITHUB_ENV + shell: bash + - name: Run zap action if needed if: ${{ github.event.action == 'cron-trigger-action' || github.event_name == 'workflow_dispatch' }} env: From 3255af6ca4b59bc8ac16b07d60d438b745474931 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 11:02:48 +0300 Subject: [PATCH 04/14] Remove test OCI docker in main-build --- .github/workflows/main-build.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index aa4e2755c4..db31fe585f 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -74,17 +74,6 @@ jobs: echo "version=${DOCKER_TAG}" >> "$GITHUB_OUTPUT" shell: bash - - name: Test OCI docker scripts - run: | - wget https://download.onlyoffice.com/docspace/docspace-enterprise-install.sh - sed '/bash install-Docker.sh/i sed -i "1i set -x" install-Docker.sh' -i docspace-enterprise-install.sh - sed '/bash install-Docker.sh/i sed -i "/docker-compose.*up -d/ s/$/ --quiet-pull/" install-Docker.sh' -i docspace-enterprise-install.sh - sudo bash docspace-enterprise-install.sh docker -docsi onlyoffice/documentserver-ee -skiphc true -noni true $([ ${{ matrix.branch }} != "master" ] && echo "-gb ${{ matrix.branch }} -s 4testing-") || exit $? - - echo -n "Waiting for all containers to start..." - timeout 300 bash -c 'while docker ps | grep -q "starting"; do sleep 5; done' && echo "OK" || echo "container_status=timeout" >> $GITHUB_ENV - shell: bash - - name: Run zap action if needed if: ${{ github.event.action == 'cron-trigger-action' || github.event_name == 'workflow_dispatch' }} env: From 2cd7b52e327ea47881aa159f276cb55f89d86828 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 12:21:38 +0300 Subject: [PATCH 05/14] Add triggering on branch --- .github/workflows/main-build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index db31fe585f..9f3b080383 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -88,3 +88,15 @@ jobs: -f branch=${{ matrix.branch }} \ -f version=${VERSION} fi + + - name: Dispatch Action + run: | + echo "Triggering ci-oci-docker-install on branch ${{ matrix.branch }}" + + curl \ + -X POST \ + -u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/ONLYOFFICE/DocSpace/actions/workflows/ci-oci-docker-install.yml/dispatches \ + -d '{"ref": "'"${{ matrix.branch }}"'", "inputs": {"offline": "false"}}' + shell: bash From 4b4ad18a17a1c66aa60461805103b3bd1d706566 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 12:57:11 +0300 Subject: [PATCH 06/14] Check OCI docker operability --- .github/workflows/main-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 9f3b080383..4e6073b9df 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -13,7 +13,10 @@ on: - config-trigger-action - client-trigger-action - server-trigger-action - + push: + branches: + - feature/oci-install-docker + env: DOCKER_PATH: "/install/docker" REPO: "onlyoffice" From 4620c28f61544caf2af1b93281e69de4322c0592 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 13:06:59 +0300 Subject: [PATCH 07/14] Remove check OCI --- .github/workflows/main-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 4e6073b9df..c878592d22 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -13,10 +13,6 @@ on: - config-trigger-action - client-trigger-action - server-trigger-action - push: - branches: - - feature/oci-install-docker - env: DOCKER_PATH: "/install/docker" REPO: "onlyoffice" From 4871be37e664cf262618b777e7aedac482baab9c Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 14:17:31 +0300 Subject: [PATCH 08/14] Add check OCI docker operability --- .github/workflows/config-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/config-build.yml b/.github/workflows/config-build.yml index 791ed67162..690a61d5e0 100644 --- a/.github/workflows/config-build.yml +++ b/.github/workflows/config-build.yml @@ -6,6 +6,7 @@ on: - 'hotfix/v*' - 'release/v*' - 'develop' + - 'feature/oci-install-docker' paths: - 'config/**' - 'install/docker/Dockerfile.app' From d54be79b07a5da7ba2394a94eb99f2a99d90e868 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 14:25:25 +0300 Subject: [PATCH 09/14] Add check action OCI docker --- .github/workflows/config-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/config-build.yml b/.github/workflows/config-build.yml index 690a61d5e0..7482364060 100644 --- a/.github/workflows/config-build.yml +++ b/.github/workflows/config-build.yml @@ -11,6 +11,7 @@ on: - 'config/**' - 'install/docker/Dockerfile.app' - 'install/docker/*entrypoint*.*' + - '.github/workflows/config-build.yml' workflow_dispatch: jobs: From 039c97632920ea1f6c0e70afa527bcbb54b11aae Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 15:26:51 +0300 Subject: [PATCH 10/14] Add env branche name --- .github/workflows/ci-oci-docker-install.yml | 8 ++++++-- .github/workflows/config-build.yml | 2 +- .github/workflows/main-build.yml | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-oci-docker-install.yml b/.github/workflows/ci-oci-docker-install.yml index b3407b4384..c50a82ca4a 100644 --- a/.github/workflows/ci-oci-docker-install.yml +++ b/.github/workflows/ci-oci-docker-install.yml @@ -18,15 +18,19 @@ on: required: true default: false type: boolean + repository_dispatch: + types: + - oci-docker-install-trigger jobs: Install-OneClickInstall-Docker: runs-on: ubuntu-22.04 + env: + BRANCH_NAME: ${{ github.event.client_payload.branch || 'master' }} steps: - name: Determine Branch Name run: | - BRANCH_NAME=$([ "${{ github.event_name }}" = "pull_request" ] && echo "${{ github.event.pull_request.head.ref }}" || echo "${GITHUB_REF#refs/heads/}") - echo "BRANCH_NAME=${BRANCH_NAME:-master}" >> $GITHUB_ENV + echo "BRANCH_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV - name: Free Disk Space run: | diff --git a/.github/workflows/config-build.yml b/.github/workflows/config-build.yml index 7482364060..c4c47e478b 100644 --- a/.github/workflows/config-build.yml +++ b/.github/workflows/config-build.yml @@ -11,7 +11,7 @@ on: - 'config/**' - 'install/docker/Dockerfile.app' - 'install/docker/*entrypoint*.*' - - '.github/workflows/config-build.yml' + - '.github/workflows/ci-oci-docker-install.yml' workflow_dispatch: jobs: diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index c878592d22..7d0fdb14e3 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -13,6 +13,7 @@ on: - config-trigger-action - client-trigger-action - server-trigger-action + env: DOCKER_PATH: "/install/docker" REPO: "onlyoffice" @@ -96,6 +97,5 @@ jobs: -X POST \ -u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \ -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/ONLYOFFICE/DocSpace/actions/workflows/ci-oci-docker-install.yml/dispatches \ - -d '{"ref": "'"${{ matrix.branch }}"'", "inputs": {"offline": "false"}}' - shell: bash + https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/dispatches \ + -d '{"event_type": "oci-docker-install-trigger", "client_payload": {"branch": "'"${{ matrix.branch }}"'"}}' From c46efdc0b1749ab82710bb45ff470ec274397a5e Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 15:45:32 +0300 Subject: [PATCH 11/14] Change branch for test OCI docker --- install/docker/Dockerfile.app | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index ecd1f83e86..1278e85fbc 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -43,9 +43,9 @@ RUN apt-get -y update && \ rm -rf /var/lib/apt/lists/* ADD https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/git/refs/heads/${GIT_BRANCH} version.json -RUN git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \ - git clone --recurse-submodules -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \ - git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client && \ +RUN git clone -b develop https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \ + git clone --recurse-submodules -b develop https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \ + git clone -b develop https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client && \ git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/docspace-plugins.git ${SRC_PATH}/plugins && \ git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/ASC.Web.Campaigns.git ${SRC_PATH}/campaigns From 25a1c388fb5c8f34a493293fac11406ef6caa0ee Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 17:08:50 +0300 Subject: [PATCH 12/14] Add determine branch name --- .github/workflows/ci-oci-docker-install.yml | 9 +++++---- .github/workflows/main-build.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-oci-docker-install.yml b/.github/workflows/ci-oci-docker-install.yml index c50a82ca4a..912c360750 100644 --- a/.github/workflows/ci-oci-docker-install.yml +++ b/.github/workflows/ci-oci-docker-install.yml @@ -8,7 +8,7 @@ on: - 'install/OneClickInstall/install-Docker.sh' push: branches: - - master + - develop - 'release/**' - 'hotfix/**' workflow_dispatch: @@ -25,12 +25,13 @@ on: jobs: Install-OneClickInstall-Docker: runs-on: ubuntu-22.04 - env: - BRANCH_NAME: ${{ github.event.client_payload.branch || 'master' }} steps: - name: Determine Branch Name run: | - echo "BRANCH_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV + BRANCH_NAME=$([ "${{ github.event_name }}" = "pull_request" ] && echo "${{ github.event.pull_request.head.ref }}" || \ + [ "${{ github.event_name }}" = "repository_dispatch" ] && echo "${{ github.event.client_payload.branch }}" || \ + echo "${GITHUB_REF#refs/heads/}") + echo "BRANCH_NAME=${BRANCH_NAME:-master}" >> $GITHUB_ENV - name: Free Disk Space run: | diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 7d0fdb14e3..1ebf06cc95 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -91,7 +91,7 @@ jobs: - name: Dispatch Action run: | - echo "Triggering ci-oci-docker-install on branch ${{ matrix.branch }}" + echo "OCI docker test on branch ${{ matrix.branch }}" curl \ -X POST \ From 339291e555c0d9d27ec57d6f69d396bcedb441f7 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 17:31:54 +0300 Subject: [PATCH 13/14] Fix cosmetic issues in OCI docker test --- .github/workflows/ci-oci-docker-install.yml | 4 ++-- .github/workflows/config-build.yml | 2 -- install/docker/Dockerfile.app | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-oci-docker-install.yml b/.github/workflows/ci-oci-docker-install.yml index 912c360750..18ef78e4b4 100644 --- a/.github/workflows/ci-oci-docker-install.yml +++ b/.github/workflows/ci-oci-docker-install.yml @@ -8,9 +8,9 @@ on: - 'install/OneClickInstall/install-Docker.sh' push: branches: - - develop - - 'release/**' - 'hotfix/**' + - 'release/**' + - 'develop' workflow_dispatch: inputs: offline: diff --git a/.github/workflows/config-build.yml b/.github/workflows/config-build.yml index c4c47e478b..791ed67162 100644 --- a/.github/workflows/config-build.yml +++ b/.github/workflows/config-build.yml @@ -6,12 +6,10 @@ on: - 'hotfix/v*' - 'release/v*' - 'develop' - - 'feature/oci-install-docker' paths: - 'config/**' - 'install/docker/Dockerfile.app' - 'install/docker/*entrypoint*.*' - - '.github/workflows/ci-oci-docker-install.yml' workflow_dispatch: jobs: diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index 1278e85fbc..ecd1f83e86 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -43,9 +43,9 @@ RUN apt-get -y update && \ rm -rf /var/lib/apt/lists/* ADD https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/git/refs/heads/${GIT_BRANCH} version.json -RUN git clone -b develop https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \ - git clone --recurse-submodules -b develop https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \ - git clone -b develop https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client && \ +RUN git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \ + git clone --recurse-submodules -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \ + git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client && \ git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/docspace-plugins.git ${SRC_PATH}/plugins && \ git clone -b "master" --depth 1 https://github.com/ONLYOFFICE/ASC.Web.Campaigns.git ${SRC_PATH}/campaigns From 6c2bfd9f404f9e9844b3202bdf7bdfc43f7e3bf7 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Thu, 21 Nov 2024 18:14:26 +0300 Subject: [PATCH 14/14] Fix cosmetic issues in OCI docker --- .github/workflows/ci-oci-docker-install.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-oci-docker-install.yml b/.github/workflows/ci-oci-docker-install.yml index 18ef78e4b4..580b1b2de2 100644 --- a/.github/workflows/ci-oci-docker-install.yml +++ b/.github/workflows/ci-oci-docker-install.yml @@ -28,9 +28,17 @@ jobs: steps: - name: Determine Branch Name run: | - BRANCH_NAME=$([ "${{ github.event_name }}" = "pull_request" ] && echo "${{ github.event.pull_request.head.ref }}" || \ - [ "${{ github.event_name }}" = "repository_dispatch" ] && echo "${{ github.event.client_payload.branch }}" || \ - echo "${GITHUB_REF#refs/heads/}") + case "${{ github.event_name }}" in + "pull_request") + BRANCH_NAME="${{ github.event.pull_request.head.ref }}" + ;; + "repository_dispatch") + BRANCH_NAME="${{ github.event.client_payload.branch }}" + ;; + *) + BRANCH_NAME="${GITHUB_REF#refs/heads/}" + ;; + esac echo "BRANCH_NAME=${BRANCH_NAME:-master}" >> $GITHUB_ENV - name: Free Disk Space