Skip to content

Commit

Permalink
feat(ci): support debugging CI server through ssh
Browse files Browse the repository at this point in the history
Fixes hyperledger#717

Signed-off-by: <youngone.lee@accenture.com>
Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
  • Loading branch information
petermetz authored and Leeyoungone committed Aug 18, 2021
1 parent ef7dedd commit ee06ad5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Cactus CI Github Workflow


# Triggers the workflow on push or pull request events
on:
push:
Expand All @@ -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


14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ee06ad5

Please sign in to comment.