Skip to content

Commit c64e4d5

Browse files
annahiletaAaronWDS
andauthored
Configuring the tests to run in the CI/CD workflow with keys from GitHub secrets (#84)
* added ability to get keys from environment * added a maven workflow * fixes after the code review * added back the missing dependency * added support of the new application.json structure * added missing import * fixing failing tests * test trigger --------- Co-authored-by: AaronWDS <aaron.wilde@docusign.com>
1 parent 160730e commit c64e4d5

3 files changed

Lines changed: 44 additions & 8 deletions

File tree

‎.github/workflows/maven.yml‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Java launcher
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin'
21+
cache: maven
22+
- name: Download dependancies
23+
env:
24+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
25+
IMPERSONATED_USER_ID: ${{ secrets.IMPERSONATED_USER_ID }}
26+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
27+
SIGNER_EMAIL: ${{ secrets.SIGNER_EMAIL }}
28+
SIGNER_NAME: ${{ secrets.SIGNER_NAME }}
29+
run: mvn install
30+
- name: Build with Maven
31+
env:
32+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
33+
IMPERSONATED_USER_ID: ${{ secrets.IMPERSONATED_USER_ID }}
34+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
35+
SIGNER_EMAIL: ${{ secrets.SIGNER_EMAIL }}
36+
SIGNER_NAME: ${{ secrets.SIGNER_NAME }}
37+
run: mvn -B package --file pom.xml

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Also, in order to select JSON Web Token authentication in the launcher, in src/m
126126
1. Set a name and email address for the signer. In application.json, save an email address as `DS_SIGNER_EMAIL` and a name as `DS_SIGNER_NAME`.
127127
**Note:** Protect your personal information. Please make sure that application.json will not be stored in your source code repository.
128128
1. Run the launcher: `mvn exec:java -Dexec.mainClass="com.docusign.jwtconsoleapp.JWTConsoleApp"` (`mvn exec:java -D"exec.mainClass"="com.docusign.jwtconsoleapp.JWTConsoleApp"`)
129-
The launcher automatically opens.
129+
The launcher automatically opens.
130130
1. On the black navigation bar, select **Login**.
131131
1. From the picklist, select **JSON Web Token (JWT) grant** > **Authenticate with DocuSign**.
132132
1. When prompted, log in to your DocuSign developer account. If this is your first time using the app, select **ACCEPT** at the consent window.

‎pom.xml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
<artifactId>spring-boot-starter-oauth2-client</artifactId>
4747
</dependency>
4848

49+
<dependency>
50+
<groupId>io.github.cdimascio</groupId>
51+
<artifactId>dotenv-java</artifactId>
52+
<version>2.2.0</version>
53+
</dependency>
54+
4955
<dependency>
5056
<groupId>org.projectlombok</groupId>
5157
<artifactId>lombok</artifactId>
@@ -121,13 +127,6 @@
121127
<version>${admin.version}</version>
122128
</dependency>
123129

124-
<dependency>
125-
<groupId>org.projectlombok</groupId>
126-
<artifactId>lombok</artifactId>
127-
<version>RELEASE</version>
128-
<scope>compile</scope>
129-
</dependency>
130-
131130
<dependency>
132131
<groupId>org.springframework.boot</groupId>
133132
<artifactId>spring-boot-autoconfigure</artifactId>

0 commit comments

Comments
 (0)