From 906bb7450c3442458d8bef872c6575a4ab0bba19 Mon Sep 17 00:00:00 2001 From: dandimeo Date: Thu, 26 Oct 2023 10:18:16 +0200 Subject: [PATCH 01/11] implement update-vendor job --- .circleci/base_config.yml | 46 ++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index a3ecd46eb5..de19796589 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -311,6 +311,32 @@ commands: git push -f jobs: + update-vendor: + docker: + - image: cimg/go:1.21.3 + steps: + - add_ssh_keys: + fingerprints: + - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" + - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" + - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" + - run: ssh-keyscan github.com >> ~/.ssh/known_hosts + - run: + name: Clone docs repo + command: | + git clone --depth 1 https://github.com/arangodb/docs-hugo.git --branch $CIRCLE_BRANCH + - run: + name: Update vendor dependencies folder + command: | + cd docs-hugo/toolchain/arangoproxy + rm -r vendor go.mod go.sum + go mod tidy + go mod vendor + - persist_to_workspace: + root: . + paths: + - docs-hugo + create-docs-images: parameters: architecture: @@ -324,10 +350,8 @@ jobs: image: ubuntu-2004:current resource_class: << parameters.executor >> steps: - - run: - name: Clone docs repo - command: | - git clone --depth 1 https://github.com/arangodb/docs-hugo.git --branch $CIRCLE_BRANCH + - attach_workspace: + at: . - run: name: Create docker images command: | @@ -341,11 +365,11 @@ jobs: name: Push docker images command: | cd docs-hugo/toolchain/docker - echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin + # echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin - docker push arangodb/docs-hugo:site-<< parameters.architecture >> - docker push arangodb/docs-hugo:arangoproxy-<< parameters.architecture >> - docker push arangodb/docs-hugo:toolchain-<< parameters.architecture >> + # docker push arangodb/docs-hugo:site-<< parameters.architecture >> + # docker push arangodb/docs-hugo:arangoproxy-<< parameters.architecture >> + # docker push arangodb/docs-hugo:toolchain-<< parameters.architecture >> plain-build: @@ -533,15 +557,21 @@ workflows: create-docs-images-amd64: when: { equal: [ create-docs-images-amd64, << pipeline.parameters.workflow >> ] } jobs: + - update-vendor - create-docs-images: architecture: "amd64" executor: "medium" + requires: + - update-vendor create-docs-images-arm64: when: { equal: [ create-docs-images-arm64, << pipeline.parameters.workflow >> ] } jobs: + - update-vendor - create-docs-images: architecture: "arm64" executor: "arm.medium" + requires: + - update-vendor plain: when: { equal: [ plain-build, << pipeline.parameters.workflow >> ] } jobs: From b80da4fa80e8b04ddea08bb30ab5a8fd17e95e5b Mon Sep 17 00:00:00 2001 From: dandimeo Date: Thu, 26 Oct 2023 10:21:18 +0200 Subject: [PATCH 02/11] do not remove go.mod --- .circleci/base_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index de19796589..b0b2807668 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -329,7 +329,7 @@ jobs: name: Update vendor dependencies folder command: | cd docs-hugo/toolchain/arangoproxy - rm -r vendor go.mod go.sum + rm -r vendor go.sum go mod tidy go mod vendor - persist_to_workspace: From f342530a002bb0dafb82452acdc99e815e292231 Mon Sep 17 00:00:00 2001 From: dandimeo Date: Thu, 26 Oct 2023 10:34:59 +0200 Subject: [PATCH 03/11] create commit step in job --- .circleci/base_config.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index b0b2807668..7c3289c6cb 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -332,6 +332,23 @@ jobs: rm -r vendor go.sum go mod tidy go mod vendor + - run: + name: Create PR with new vendor folder + command: | + cd docs-hugo/toolchain/arangoproxy + git checkout -b update-vendor-$CIRCLE_BUILD_NUM + + git config user.email "daniele@arangodb.com" + git config user.name "CircleCI Job" + git add vendor/ + git commit --allow-empty -m "[skip ci] Update ArangoProxy vendor/ folder" + + git push -u origin update-vendor-$CIRCLE_BUILD_NUM + curl -X POST https://candid-daffodil-f96315.netlify.app/.netlify/functions/circleci \ + --header 'docs-webhook-event: scheduled-create-pr' \ + --header "docs-branch-name: update-vendor-$CIRCLE_BUILD_NUM" \ + --header "docs-pr-title: [CircleCI Generated] update-vendor-$CIRCLE_BUILD_NUM" \ + --header "docs-pr-body: Automatically updated ArangoProxy vendor folder CircleCI << pipeline.parameters.workflow >> workflow" - persist_to_workspace: root: . paths: From b10d90c30628d2ab75269e6908bf28ce86fbb2a2 Mon Sep 17 00:00:00 2001 From: dandimeo Date: Thu, 26 Oct 2023 10:46:10 +0200 Subject: [PATCH 04/11] use ssh git clone --- .circleci/base_config.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 7c3289c6cb..e2bf9bc13e 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -314,17 +314,18 @@ jobs: update-vendor: docker: - image: cimg/go:1.21.3 + environment: + GIT_SSH_COMMAND: "ssh -o IdentitiesOnly=yes" steps: - add_ssh_keys: fingerprints: - - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" - - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" - - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" - - run: ssh-keyscan github.com >> ~/.ssh/known_hosts + - "1e:e3:7e:8c:55:be:3d:56:bc:4c:1c:d7:d6:26:f2:e5" + - "20:72:b8:99:35:4c:7c:23:60:da:f2:5e:43:34:ba:79" + - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - run: name: Clone docs repo command: | - git clone --depth 1 https://github.com/arangodb/docs-hugo.git --branch $CIRCLE_BRANCH + git clone --depth 1 git@github.com:arangodb/docs-hugo.git --branch $CIRCLE_BRANCH - run: name: Update vendor dependencies folder command: | @@ -340,7 +341,7 @@ jobs: git config user.email "daniele@arangodb.com" git config user.name "CircleCI Job" - git add vendor/ + git add vendor/ go.mod go.sum git commit --allow-empty -m "[skip ci] Update ArangoProxy vendor/ folder" git push -u origin update-vendor-$CIRCLE_BUILD_NUM From 637e194aa76aa518c3330c24d03adc06af66082c Mon Sep 17 00:00:00 2001 From: dandimeo Date: Thu, 26 Oct 2023 10:54:21 +0200 Subject: [PATCH 05/11] try other keys --- .circleci/base_config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index e2bf9bc13e..72ee26cb7e 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -319,8 +319,9 @@ jobs: steps: - add_ssh_keys: fingerprints: - - "1e:e3:7e:8c:55:be:3d:56:bc:4c:1c:d7:d6:26:f2:e5" - - "20:72:b8:99:35:4c:7c:23:60:da:f2:5e:43:34:ba:79" + - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" + - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" + - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - run: name: Clone docs repo From 95f0214356080cb37d51d3f43e15743e9e3ca37a Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 11:42:38 +0100 Subject: [PATCH 06/11] Change email --- .circleci/base_config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 3c9ddddf27..da9cc8ecf7 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -273,7 +273,7 @@ commands: fi cd /home/circleci/project/docs-hugo/site - git config user.email "daniele@arangodb.com" + git config user.email "simran@arangodb.com" git config user.name "CircleCI Job" git add data/ content/ git commit --allow-empty -m "[skip ci] Automatic commit of generated files from CircleCI" @@ -340,7 +340,7 @@ jobs: cd docs-hugo/toolchain/arangoproxy git checkout -b update-vendor-$CIRCLE_BUILD_NUM - git config user.email "daniele@arangodb.com" + git config user.email "simran@arangodb.com" git config user.name "CircleCI Job" git add vendor/ go.mod go.sum git commit --allow-empty -m "[skip ci] Update ArangoProxy vendor/ folder" From bb780646b583a4a3eea2dde811af26c06fc3fb51 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 11:54:08 +0100 Subject: [PATCH 07/11] CircleCI: Remove api-docs commit leftover --- .circleci/base_config.yml | 37 ------------------------------------- .circleci/config.yml | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index da9cc8ecf7..296ead91d3 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -289,26 +289,6 @@ commands: git push fi - commit-api-docs: - description: Commit api-docs files to api-docs repository - parameters: - version: - type: string - default: "" - tag: - type: string - default: "" - steps: - - run: - name: Clone api-docs repo - command: | - git clone git@github.com:arangodb/api-docs.git - cd /home/circleci/project/api-docs - cp /home/circleci/project/docs-hugo/site/data/<< parameters.version >>/api-docs.json /home/circleci/project/api-docs/ - git commit --allow-empty -m 'Commit api-docs << parameters.tag >>' api-docs.json - git tag -f << parameters.tag >> - git push -f origin << parameters.tag >> - git push -f jobs: update-vendor: @@ -430,13 +410,6 @@ jobs: docker compose -f docker-compose.plain-build.yml up --abort-on-container-exit - upload-summary: summary-name: "plain-build-summary" - - when: - condition: - equal: [ "api-docs", << pipeline.parameters.workflow >> ] - steps: - - commit-api-docs: - version: << pipeline.parameters.version >> - tag: << pipeline.parameters.tag >> - persist_to_workspace: root: . @@ -571,10 +544,6 @@ jobs: - - - - workflows: create-docs-images-amd64: when: { equal: [ create-docs-images-amd64, << pipeline.parameters.workflow >> ] } @@ -602,11 +571,6 @@ workflows: requires: - plain-build - api-docs: - when: { equal: [ api-docs, << pipeline.parameters.workflow >> ] } - jobs: - - plain-build - release: when: { equal: [ release, << pipeline.parameters.workflow >> ] } jobs: @@ -632,4 +596,3 @@ workflows: - commit-generated: requires: - approve-workflow - diff --git a/.circleci/config.yml b/.circleci/config.yml index bbe2de2f52..dc90435f3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ orbs: parameters: workflow: type: enum - enum: [no-op, plain-build, generate, api-docs, release, compile, generate-scheduled, commit-generated, generate-oasisctl, create-docs-images-amd64, create-docs-images-arm64] + enum: [no-op, plain-build, generate, release, compile, generate-scheduled, commit-generated, generate-oasisctl, create-docs-images-amd64, create-docs-images-arm64] default: no-op deploy-url: From 4308c1065ed5dfc830735a2afc524f43e2a475ea Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 11:56:27 +0100 Subject: [PATCH 08/11] Try different fingerprints --- .circleci/base_config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 296ead91d3..174baaf488 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -479,10 +479,9 @@ jobs: steps: - add_ssh_keys: fingerprints: - - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" - - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" - - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" - - run: ssh-keyscan github.com >> ~/.ssh/known_hosts + - "1e:e3:7e:8c:55:be:3d:56:bc:4c:1c:d7:d6:26:f2:e5" + - "20:72:b8:99:35:4c:7c:23:60:da:f2:5e:43:34:ba:79" + - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - clone-docs-and-merge - download-generated-data - commit: From 621d6a6d9ddf095a41279d99393fabc6022fa1c9 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 12:13:47 +0100 Subject: [PATCH 09/11] No IdentitiesOnly? --- .circleci/base_config.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 174baaf488..133156d8c4 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -294,8 +294,6 @@ jobs: update-vendor: docker: - image: cimg/go:1.21.3 - environment: - GIT_SSH_COMMAND: "ssh -o IdentitiesOnly=yes" steps: - add_ssh_keys: fingerprints: @@ -479,9 +477,10 @@ jobs: steps: - add_ssh_keys: fingerprints: - - "1e:e3:7e:8c:55:be:3d:56:bc:4c:1c:d7:d6:26:f2:e5" - - "20:72:b8:99:35:4c:7c:23:60:da:f2:5e:43:34:ba:79" - - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts + - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" + - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" + - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" + - run: ssh-keyscan github.com >> ~/.ssh/known_hosts - clone-docs-and-merge - download-generated-data - commit: From 76ce11c8d089fc31f3ff0b3de35367def27304da Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 12:22:52 +0100 Subject: [PATCH 10/11] Not set SSH keys? --- .circleci/base_config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 133156d8c4..918134f683 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -295,12 +295,6 @@ jobs: docker: - image: cimg/go:1.21.3 steps: - - add_ssh_keys: - fingerprints: - - "7a:1d:7f:0a:70:eb:2b:7d:25:10:9b:e8:dc:04:53:9a" - - "28:4f:0b:b7:71:cd:39:ab:c0:33:65:4f:da:6a:cc:8e" - - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" - - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - run: name: Clone docs repo command: | From 00868e646b6bf8143c97542b4742247e0e17a59a Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Wed, 22 Nov 2023 13:58:16 +0100 Subject: [PATCH 11/11] Try with only R/W deploy key --- .circleci/base_config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/base_config.yml b/.circleci/base_config.yml index 918134f683..3c76474e50 100644 --- a/.circleci/base_config.yml +++ b/.circleci/base_config.yml @@ -295,6 +295,11 @@ jobs: docker: - image: cimg/go:1.21.3 steps: + - add_ssh_keys: + fingerprints: + # GitHub Deploy Key SHA256:95F/qmjGDkD1MS5Q6UVPbVGpy97JZrHi/4AIxka+vZ4 + - "bc:4d:f3:df:53:ad:22:d8:60:5d:10:d8:fd:74:d2:cd" + - run: ssh-keyscan github.com >> ~/.ssh/known_hosts && cat ~/.ssh/known_hosts - run: name: Clone docs repo command: |