From ee06ad529767bc7225a8066db27a2896571ebb58 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 4 Aug 2021 11:48:28 -0700 Subject: [PATCH] feat(ci): support debugging CI server through ssh Fixes #717 Signed-off-by: Signed-off-by: Youngone Lee --- .github/workflows/ci.yml | 9 ++++++++- CONTRIBUTING.md | 14 ++++++++++++++ package.json | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc732eb9fb..5b55a54855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ name: Cactus CI Github Workflow + # Triggers the workflow on push or pull request events on: push: @@ -26,7 +27,13 @@ jobs: uses: actions/setup-node@v2.1.2 with: node-version: ${{ matrix.node-version }} - - uses: actions/checkout@v2.3.4 + - name: Setup upterm session + uses: lhotari/action-upterm@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v2.3.4 - run: ./tools/ci.sh + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2de0554702..36399e53ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,8 @@ - [What is npx used for?](#what-is-npx-used-for) - [What's the equivalent of npx for Yarn?](#whats-the-equivalent-of-npx-for-yarn) - [Debugging a test case](#debugging-a-test-case) + - [Debugging the CI server through the ssh](#debugging-the-ci-server-through-the-ssh) + - [Getting into the SSH connection](#getting-into-the-ssh-connection) - [All-In-One Docker Images for Ledger Connector Plugins](#all-in-one-docker-images-for-ledger-connector-plugins) - [Test Automation of Ledger Plugins](#test-automation-of-ledger-plugins) - [Building the SDK](#building-the-sdk) @@ -409,6 +411,18 @@ Breakpoints will work as long as you are debugging code in the same package. > Source map support is partial at this point but actively being worked on. +### Debugging the CI server through the ssh + +#### Getting into the SSH connection + Upload your public key onto github if not done so already. A public key is necessary to join the ssh connection to use upterm. A comprehensive guide is linked here (insert link here). + + Edit the `ci.yml` file by following the steps here (insert link) to create a upterm session within `.github/workflows` by adding a new build step. + + By creating a PR for the edited `ci.yml` file, this will the CI to run their tests. There are two ways to navigate to CIs. + 1) Go to the PR and click the `checks` tab + 2) Go to the `Actions` tab within the main Hyperledger Cactus Repository + + Click on the `CI Cactus workflow`. There should be a new job you've created be listed underneath the `build (ubuntu-20.04)` jobs. Click on the the new job (what's you've named your build) and locate the SSH Session within the `Setup Upterm Session` dropdown. Copy the SSH command that start with `ssh` and ends in `.dev`. Open Ubuntu and Take paste the SSH command script in order to begin an upterm. ### All-In-One Docker Images for Ledger Connector Plugins diff --git a/package.json b/package.json index 731766fce7..5e92c57d33 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ ], "scripts": { "run-ci": "./tools/ci.sh", + "reset": "git clean -f -X && yarn run configure", "configure": "yarn install --frozen-lockfile --non-interactive && yarn run build:dev:backend", "install-yarn": "npm install --global yarn@1.19.0", "custom-checks": "ts-node ./tools/custom-checks/run-custom-checks.ts",