Skip to content

Commit

Permalink
add cicd param files for dev/test/prod
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Sherman <[email protected]>
  • Loading branch information
usingtechnology committed Sep 4, 2024
1 parent a1cca0b commit bd1f8cf
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deploy-to-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ runs:
if [[ "${{ inputs.job_name }}" == pr-* ]]; then
oc process --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f openshift/ess.cm.yaml -p APP_NAME=${{ inputs.acronym }} -p JOB_NAME=${{ inputs.job_name }} -p SOURCE=${{ inputs.job_name }} -o yaml | oc apply --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f -
else
oc process --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f openshift/ess.cm.yaml -p APP_NAME=${{ inputs.acronym }} -p JOB_NAME=${{ inputs.job_name }} -p SOURCE=${{ inputs.acronym }} -o yaml | oc apply --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f -
oc process --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f openshift/ess.cm.yaml -p APP_NAME=${{ inputs.acronym }} -p JOB_NAME=${{ inputs.job_name }} --param-file=openshift/ess.${{ inputs.namespace_environment }}.param -o yaml | oc apply --namespace ${{ inputs.namespace_prefix }}-${{ inputs.namespace_environment }} -f -
fi
- name: Deploy App
Expand Down
12 changes: 9 additions & 3 deletions event-stream-service/pullConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ globalThis.WebSocket = require("websocket").w3cwebsocket;
const { connect } = require("nats.ws");

// connection info
const servers = ["ess-a191b5-dev.apps.silver.devops.gov.bc.ca"]; //["localhost:4222", "localhost:4223", "localhost:4224"];
let servers = [];
if (process.env.SERVERS) {
servers = process.env.SERVERS.split(",");
} else {
// running locally
servers = ["localhost:4222", "localhost:4223", "localhost:4224"];
}

let nc = undefined; // nats connection
let js = undefined; // jet stream
Expand All @@ -18,8 +24,7 @@ const STREAM_NAME = "CHEFS";
const FILTER_SUBJECTS = ["PUBLIC.forms.>", "PRIVATE.forms.>"];
const MAX_MESSAGES = 2;
const DURABLE_NAME = "pullConsumer";
const ENCRYPTION_KEY =
"ad5520469720325d1694c87511afda28a0432dd974cb77b5b4b9f946a5af6985";
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY || undefined;

const printMsg = (m) => {
// illustrate grabbing the sequence and timestamp from the nats message...
Expand Down Expand Up @@ -64,6 +69,7 @@ const init = async () => {
console.log(`connect to nats server(s) ${servers} as 'anonymous'...`);
nc = await connect({
servers: servers,
reconnectTimeWait: 10 * 1000, // 10s
});

console.log("access jetstream...");
Expand Down
4 changes: 4 additions & 0 deletions openshift/ess.dev.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FEATURE=false
STREAMNAME=CHEFS
SOURCE=chefs-dev
DOMAIN=forms
4 changes: 4 additions & 0 deletions openshift/ess.prod.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FEATURE=false
STREAMNAME=CHEFS
SOURCE=chefs
DOMAIN=forms
4 changes: 4 additions & 0 deletions openshift/ess.test.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FEATURE=false
STREAMNAME=CHEFS
SOURCE=chefs-test
DOMAIN=forms

0 comments on commit bd1f8cf

Please sign in to comment.