From d6d9c428079a99c399c58e45dac29aae5259256d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 12:19:18 +0200 Subject: [PATCH 01/10] Add CircleCI continuous deployment --- .circleci/config.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..9d83a797 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,29 @@ +version: 2.1 + +orbs: + node: circleci/node@5.0.2 + +jobs: + build: + executor: node/default + steps: + - checkout + - run: + command: git submodule update --init + name: Fetch submodules + - node/install-packages: + pkg-manager: yarn + - run: + command: cp config.json.template config.json + name: Copy config + - run: + command: yarn build-lib + name: Build Codecast lib + +workflows: + deploy: + jobs: + - build: + filters: + branches: + only: lib From c9313e7f8ed546cd31ebe9548d113dd724934da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 12:32:53 +0200 Subject: [PATCH 02/10] Update config --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d83a797..b067c45c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,9 @@ jobs: executor: node/default steps: - checkout + - run: + command: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + name: "Setup Node auth token" - run: command: git submodule update --init name: Fetch submodules From 4ac0172386ddffb400ff076fe90980a196d32bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 12:36:06 +0200 Subject: [PATCH 03/10] Update CircleCI config --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b067c45c..64fd46b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,10 @@ jobs: steps: - checkout - run: - command: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + command: | + echo "@france-ioi:registry=https://npm.pkg.github.com/" > ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + cat ~/.npmrc name: "Setup Node auth token" - run: command: git submodule update --init From 98757142d1c2cf8e892a6c75b1e0dca59242a13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 12:37:31 +0200 Subject: [PATCH 04/10] Update CircleCI config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 64fd46b0..94233637 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,8 +10,8 @@ jobs: - checkout - run: command: | - echo "@france-ioi:registry=https://npm.pkg.github.com/" > ~/.npmrc - echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + echo "@france-ioi:registry=https://npm.pkg.github.com/" >> ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc cat ~/.npmrc name: "Setup Node auth token" - run: From e0ede9cb4b1ee1106808c095d7492f0b81e7d373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 12:40:08 +0200 Subject: [PATCH 05/10] Update CircleCI config --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94233637..466cc976 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,7 @@ jobs: - checkout - run: command: | + echo "registry=https://registry.npmjs.org/" >> ~/.npmrc echo "@france-ioi:registry=https://npm.pkg.github.com/" >> ~/.npmrc echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc cat ~/.npmrc @@ -17,8 +18,10 @@ jobs: - run: command: git submodule update --init name: Fetch submodules - - node/install-packages: - pkg-manager: yarn + - run: + command: yarn install --frozen-lockfile +# - node/install-packages: +# pkg-manager: yarn - run: command: cp config.json.template config.json name: Copy config From e638c79d0c95ef9a8a94dd35d2e4ad53e43ac78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 15:02:02 +0200 Subject: [PATCH 06/10] Update CircleCI config --- .circleci/config.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 466cc976..5541a85e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,21 +13,38 @@ jobs: echo "registry=https://registry.npmjs.org/" >> ~/.npmrc echo "@france-ioi:registry=https://npm.pkg.github.com/" >> ~/.npmrc echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc - cat ~/.npmrc name: "Setup Node auth token" - run: command: git submodule update --init name: Fetch submodules - - run: - command: yarn install --frozen-lockfile -# - node/install-packages: -# pkg-manager: yarn + - node/install-packages: + pkg-manager: yarn - run: command: cp config.json.template config.json name: Copy config - run: command: yarn build-lib name: Build Codecast lib + - persist_to_workspace: + root: . + paths: + - 'build' + commit: + machine: true + steps: + - attach_workspace: + at: . + - run: + command: | + ls -asl build + git config credential.helper cache + git config user.email "admin@france-ioi.org" + git config user.name "Deployment" + git clone git@github.com:France-ioi/bebras-modules.git + cp build/index.js bebras-modules/ext/codecast/7.4/index.js + cp build/index.css bebras-modules/ext/codecast/7.4/index.css + cp build/index.worker.worker.js bebras-modules/ext/codecast/7.4/index.worker.worker.js + git commit --allow-empty -m "Upgrade Codecast 7.4" workflows: deploy: @@ -36,3 +53,9 @@ workflows: filters: branches: only: lib + - commit: + requires: + - build + filters: + branches: + only: lib From 35c13207ef4c77365270a2b26a674e22bcde7d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 15:07:35 +0200 Subject: [PATCH 07/10] Update CircleCI config --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5541a85e..a26e69ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,15 +35,17 @@ jobs: - attach_workspace: at: . - run: + name: "Commit changes" command: | ls -asl build + git clone git@github.com:France-ioi/bebras-modules.git + cd bebras-modules git config credential.helper cache git config user.email "admin@france-ioi.org" git config user.name "Deployment" - git clone git@github.com:France-ioi/bebras-modules.git - cp build/index.js bebras-modules/ext/codecast/7.4/index.js - cp build/index.css bebras-modules/ext/codecast/7.4/index.css - cp build/index.worker.worker.js bebras-modules/ext/codecast/7.4/index.worker.worker.js + cp ../build/index.js ext/codecast/7.4/index.js + cp ../build/index.css ext/codecast/7.4/index.css + cp ../index.worker.worker.js ext/codecast/7.4/index.worker.worker.js git commit --allow-empty -m "Upgrade Codecast 7.4" workflows: From 91be79de9ceef6aece3f1385b6156c327730d4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 15:11:27 +0200 Subject: [PATCH 08/10] Update CircleCI config --- .circleci/config.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a26e69ee..af15c208 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,17 +35,23 @@ jobs: - attach_workspace: at: . - run: - name: "Commit changes" + name: "Clone bebras-modules" command: | - ls -asl build git clone git@github.com:France-ioi/bebras-modules.git + - run: + name: "Copy new files" + command: | + ls -asl build + cp build/index.js bebras-modules/ext/codecast/7.4/index.js + cp build/index.css bebras-modules/ext/codecast/7.4/index.css + cp build/index.worker.worker.js bebras-modules/ext/codecast/7.4/index.worker.worker.js + - run: + name: "Commit changes" + command: | cd bebras-modules git config credential.helper cache git config user.email "admin@france-ioi.org" git config user.name "Deployment" - cp ../build/index.js ext/codecast/7.4/index.js - cp ../build/index.css ext/codecast/7.4/index.css - cp ../index.worker.worker.js ext/codecast/7.4/index.worker.worker.js git commit --allow-empty -m "Upgrade Codecast 7.4" workflows: From 7a4cd809a8aab262499378ac8eba419aec4a6163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 15:16:09 +0200 Subject: [PATCH 09/10] Update CircleCI config --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af15c208..19941609 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,22 +9,22 @@ jobs: steps: - checkout - run: + name: "Setup Node auth token" command: | echo "registry=https://registry.npmjs.org/" >> ~/.npmrc echo "@france-ioi:registry=https://npm.pkg.github.com/" >> ~/.npmrc echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc - name: "Setup Node auth token" - run: + name: "Fetch submodules" command: git submodule update --init - name: Fetch submodules - node/install-packages: pkg-manager: yarn - run: + name: "Copy config" command: cp config.json.template config.json - name: Copy config - run: + name: "Build Codecast lib" command: yarn build-lib - name: Build Codecast lib - persist_to_workspace: root: . paths: @@ -36,8 +36,7 @@ jobs: at: . - run: name: "Clone bebras-modules" - command: | - git clone git@github.com:France-ioi/bebras-modules.git + command: git clone https://${GITHUB_USERNAME}:${NODE_AUTH_TOKEN}@github.com/France-ioi/bebras-modules.git - run: name: "Copy new files" command: | @@ -52,7 +51,11 @@ jobs: git config credential.helper cache git config user.email "admin@france-ioi.org" git config user.name "Deployment" + git add . git commit --allow-empty -m "Upgrade Codecast 7.4" + - run: + name: "Push changes" + command: git push -u origin master workflows: deploy: From b2f002935011c335281e3f9af99881e3fff0a929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 6 May 2024 15:19:37 +0200 Subject: [PATCH 10/10] Update CircleCI config --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19941609..57eebcc8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,7 +55,9 @@ jobs: git commit --allow-empty -m "Upgrade Codecast 7.4" - run: name: "Push changes" - command: git push -u origin master + command: | + cd bebras-modules + git push -u origin master workflows: deploy: