Skip to content

Commit fbe4490

Browse files
authored
feat: added logs and updated readme (#476)
* feat: added logs and updated readme * feat: updated siteminder tests volume mount path * feat: updated readmes
1 parent 5f1836f commit fbe4490

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

docker/kc-cron-job/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ BCEID_REQUESTER_IDIR_GUID=
2626
BCEID_SERVICE_ID_DEV=
2727
BCEID_SERVICE_ID_TEST=
2828
BCEID_SERVICE_ID_PROD=
29+
30+
GH_SITMINDER_TESTS_APP_ID=
31+
GH_SITMINDER_TESTS_INSTALLATION_ID=

docker/kc-cron-job/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ MS_GRAPH_API_CLIENT_SECRET_PROD=
4242

4343
will be required. They are not currently needed.
4444

45+
### Github App for Siteminder Tests
46+
47+
- Navigate to SSO Team's Github account profile settings and create a Github App. Choose `Any account` for this app to be installed.
48+
- Assign `Actions: read, write` permissions
49+
- Install the app on the `bcgov` org and `sso-keycloak` repository
50+
- Generate a private key and save it in the `keys` folder inside root of the crob job repo (`./sso-keycloak/docker/kc-cron-job`) with name `github-siteminder-tests-private-key.pem`
51+
4552
## Deployment
4653

4754
The cron jobs can be redeployed from the [helm chart](../../helm/kc-cron-job/README.md). The repository contains make commands for deploying and upgrading.

docker/kc-cron-job/siteminder-tests.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { sendRcNotification } from './helpers.js';
66

77
dotenv.config();
88

9-
const privateKey = fs.readFileSync('./github-siteminder-tests-private-key.pem', 'utf8');
9+
const privateKey = fs.readFileSync('./keys/github-siteminder-tests-private-key.pem', 'utf8');
1010

1111
async function runTests(octokit, environment) {
1212
try {
@@ -31,9 +31,11 @@ async function runTests(octokit, environment) {
3131
}
3232

3333
async function main() {
34+
console.info('Starting siteminder-tests');
3435
try {
3536
let octokit;
3637
try {
38+
console.info('Authenticating with github application');
3739
octokit = new Octokit({
3840
authStrategy: createAppAuth,
3941
auth: {
@@ -49,11 +51,13 @@ async function main() {
4951
throw new Error('Failed to authenticate with github application');
5052
}
5153

54+
console.info('Starting siteminder tests...');
5255
await runTests(octokit, 'DEV');
5356

5457
await runTests(octokit, 'TEST');
5558

5659
if (new Date().getDay() === 0) await runTests(octokit, 'PROD');
60+
console.info('Completed');
5761
} catch (err) {
5862
console.error(err);
5963
await sendRcNotification('siteminder-tests', `**${err}** \n\n` + JSON.stringify(err), true);

helm/kc-cron-job/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ The deployment steps for a new namespace follow:
1212

1313
### Github App for Siteminder Tests
1414

15-
- Navigate to SSO Team's Github account profile settings and create a Github App
15+
- Navigate to SSO Team's Github account profile settings and create a Github App. Choose `Any account` for this app to be installed.
1616
- Assign `Actions: read, write` permissions
17-
- Install the app on the user account
18-
- Generate a private key and save it in the root of the crob job repo (`./sso-keycloak/docker/kc-cron-job`) with name `github-siteminder-tests-private-key.pem`
17+
- Install the app on the `bcgov` org and `sso-keycloak` repository
18+
- Generate a private key and save it in the `keys` folder inside root of the crob job repo (`./sso-keycloak/docker/kc-cron-job`) with name `github-siteminder-tests-private-key.pem`
1919

2020
### Create `kc-cron-job-secret` secret
2121

helm/kc-cron-job/templates/cron-siteminder-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
key: rc-webhook
4747
volumeMounts:
4848
- name: github-siteminder-tests-private-key
49-
mountPath: "/usr/src/app"
49+
mountPath: "/usr/src/app/keys"
5050
readOnly: true
5151
volumes:
5252
- name: github-siteminder-tests-private-key

0 commit comments

Comments
 (0)