Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge setup-pipeline: trigger pipeline testing #4

Merged
merged 5 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions .github/openshift/deploy.backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@ parameters:
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
value: bcgov/nr-old-growth:prod-backend
- name: EMAIL_USERNAME
description: CHES service client
required: true
- name: EMAIL_PASSWORD
description: CHES service client password
required: true
- name: EMAIL_TOKEN_URL
description: CHES authentication url
required: true
- name: EMAIL_API_URL
description: CHES email api url
required: true
# - name: EMAIL_USERNAME
# description: CHES service client
# required: true
# - name: EMAIL_PASSWORD
# description: CHES service client password
# required: true
# - name: EMAIL_TOKEN_URL
# description: CHES authentication url
# required: true
# - name: EMAIL_API_URL
# description: CHES email api url
# required: true
- name: NODE_ENV
description: environment mode
required: true
objects:
- apiVersion: v1
kind: Secret
metadata:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
app: ${NAME}-${ZONE}
stringData:
email-username: "${EMAIL_USERNAME}"
email-password: "${EMAIL_PASSWORD}"
# - apiVersion: v1
# kind: Secret
# metadata:
# name: ${NAME}-${ZONE}-${COMPONENT}
# labels:
# app: ${NAME}-${ZONE}
# stringData:
# email-username: "${EMAIL_USERNAME}"
# email-password: "${EMAIL_PASSWORD}"
- apiVersion: v1
kind: ImageStream
metadata:
Expand Down Expand Up @@ -133,22 +133,22 @@ objects:
value: https://${NAME}-${ZONE}-frontend.${DOMAIN}
- name: BACKEND_URL
value: https://${NAME}-${ZONE}-backend.${DOMAIN}
- name: EMAIL_USERNAME
valueFrom:
secretKeyRef:
name: ${NAME}-${ZONE}-${COMPONENT}
key: email-username
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: ${NAME}-${ZONE}-${COMPONENT}
key: email-password
- name: EMAIL_TOKEN_URL
value: ${EMAIL_TOKEN_URL}
- name: EMAIL_API_URL
value: ${EMAIL_API_URL}
- name: EMAIL_FROM
value: "FSA_donotreply@gov.bc.ca"
# - name: EMAIL_USERNAME
# valueFrom:
# secretKeyRef:
# name: ${NAME}-${ZONE}-${COMPONENT}
# key: email-username
# - name: EMAIL_PASSWORD
# valueFrom:
# secretKeyRef:
# name: ${NAME}-${ZONE}-${COMPONENT}
# key: email-password
# - name: EMAIL_TOKEN_URL
# value: ${EMAIL_TOKEN_URL}
# - name: EMAIL_API_URL
# value: ${EMAIL_API_URL}
# - name: EMAIL_FROM
# value: "FSA_donotreply@gov.bc.ca"
- name: NODE_ENV
value: ${NODE_ENV}

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
repository: ${{ github.repository }}
token: ${{ secrets.GHCR_TOKEN }}
target: prod-backend
tags: |
${{ github.event.number }}-backend
Expand Down Expand Up @@ -91,6 +92,7 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
repository: ${{ github.repository }}
token: ${{ secrets.GHCR_TOKEN }}
target: prod-frontend
tags: |
${{ github.event.number }}-frontend
Expand Down Expand Up @@ -356,11 +358,12 @@ jobs:
# Process and apply template
oc process -f .github/openshift/deploy.backend.yml -p ZONE=${{ env.ZONE }} \
-p PROMOTE=${{ github.repository }}:${{ env.ZONE }}-backend \
-p EMAIL_USERNAME=${{ secrets.CHES_SERVICE_CLIENT }} \
-p EMAIL_PASSWORD=${{ secrets.CHES_CLIENT_PASSWORD }} \
-p EMAIL_TOKEN_URL='https://dev.oidc.gov.bc.ca/auth/realms/jbd6rnxw/protocol/openid-connect/token' \
-p EMAIL_API_URL='https://ches-dev.apps.silver.devops.gov.bc.ca/api/v1' \
-p NODE_ENV='development' | oc apply -f -
# -p EMAIL_USERNAME=${{ secrets.CHES_SERVICE_CLIENT }} \
# -p EMAIL_PASSWORD=${{ secrets.CHES_CLIENT_PASSWORD }} \
# -p EMAIL_TOKEN_URL='https://dev.oidc.gov.bc.ca/auth/realms/jbd6rnxw/protocol/openid-connect/token' \
# -p EMAIL_API_URL='https://ches-dev.apps.silver.devops.gov.bc.ca/api/v1' | oc apply -f -


# Clean previous image, if rebuilding
if [ ${{ needs.build-backend.outputs.build == 'true' }} ]
Expand Down
3 changes: 0 additions & 3 deletions backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ async function bootstrap() {
if (!origin || whitelist.indexOf(origin) !== -1) {
callback(null, true);
}
// else {
// callback(new Error('Not allowed by CORS'));
// }
},
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
<title>Old growth</title>
<title>Forest Client</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<MainHeader />
<b-container>
Hello World
Hello World !
</b-container>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/tests/MainHeader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import MainHeader from "../common/MainHeader.vue";
describe("MainHeader", () => {
it("renders properly", () => {
const wrapper = mount(MainHeader);
expect(wrapper.text()).toContain("FSA - Old Growth");
expect(wrapper.text()).toContain("FSA - Forest Client");
});
});