Skip to content

Commit 4ec063b

Browse files
authored
Merge pull request #1006 from bcgov/test
Create Latest Release
2 parents 3147351 + 2e40387 commit 4ec063b

File tree

35 files changed

+1402
-239
lines changed

35 files changed

+1402
-239
lines changed

.github/workflows/ci-build-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ jobs:
264264
NEXT_PUBLIC_HELP_API_DOCS_URL:
265265
value: '/ds/api/v2/console/'
266266
NEXT_PUBLIC_HELP_SUPPORT_URL:
267-
value: 'https://mvp.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/'
267+
value: 'https://developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/'
268268
NEXT_PUBLIC_HELP_RELEASE_URL:
269-
value: 'https://mvp.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/reference/releases/'
269+
value: 'https://developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/reference/releases/'
270270
NEXT_PUBLIC_HELP_STATUS_URL:
271271
value: 'https://uptime.com/s/bcgov-dss'
272272
NEXT_PUBLIC_DEVELOPER_IDS:

.github/workflows/ci-feat-sonar.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Sonar Scanner
22

33
on:
44
push:
5-
branches: [dev, feat/*]
5+
branches: [dev, feature/*]
66

77
env:
88
REGISTRY: ghcr.io
@@ -23,10 +23,24 @@ jobs:
2323

2424
- name: Run Tests
2525
run: |
26+
docker compose up kong-db -d
27+
28+
set -o allexport
29+
source ./.env.local
30+
LOG_LEVEL=debug
31+
KNEX_HOST=kong-db.localtest.me
32+
NEXT_PUBLIC_MOCKS=off
33+
set +o allexport
34+
2635
cd src
36+
2737
npm i
38+
npm run intg-build
2839
npm test
2940
41+
cd ..
42+
docker compose down
43+
3044
- name: SonarCloud Scan
3145
uses: sonarsource/sonarcloud-github-action@master
3246
with:

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The repo is setup to create a local deployment of the Portal along with required
2929
1. Build: Back in `api-services-portal`, run `docker compose --profile testsuite build`.
3030
1. Run: `docker compose up`. Wait for startup to complete - look for `Swagger UI registered`.
3131
1. The Portal is now live at http://oauth2proxy.localtest.me:4180
32-
1. To login, use username `local` and password `local`, or username `janis@idir` and password `awsummer`.
32+
1. To login, use username `janis@idir` and password `awsummer` (or username `local` and password `local`).
3333
1. If you have made any changes to the app code, update images by running `docker compose build` then `docker compose up`.
3434
1. Clean up: `docker compose down` removes all the hosted services
3535
@@ -67,11 +67,16 @@ Use the following configuration to run the Portal locally (outside of Docker) ag
6767
6868
1. Turn off the docker compose Portal: `docker stop apsportal`
6969
1. Configure the `oauth2-proxy` that is running in Docker:
70-
1. Update `upstreams` in `oauth2-proxy/oauth2-proxy-local.cfg` to include the IP address of your local machine, e.g. `upstreams=["http://172.100.100.01:3000"]`
70+
1. Update `upstreams` in `local/oauth2-proxy/oauth2-proxy-local.cfg` to include the IP address of your local machine, e.g. `upstreams=["http://172.100.100.01:3000"]`
7171
<br>You can obtain the IP address using `hostname -I`.
7272
7373
1. Restart the oauth2-proxy: `docker compose restart oauth2-proxy`
74+
1. Update `DESTINATION_URL` in `local/feeds/.env.local` to include the IP address of your local machine
75+
1. Restart the feeder: `docker compose restart feeder`
76+
1. Update `PORTAL_ACTIVITY_URL` in `local/gwa-api/.env.local` to include the IP address of your local machine
77+
1. Restart the feeder: `docker compose restart gwa-api`
7478
79+
7580
1. Start the Portal locally:
7681
7782
```sh

docker-compose.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ services:
8383
context: ./feeds
8484
dockerfile: Dockerfile
8585
env_file:
86-
- ./feeds/.env.local
86+
- ./local/feeds/.env.local
8787
restart: on-failure
8888
ports:
8989
- 6000:6000
@@ -117,15 +117,15 @@ services:
117117
- ./local/db/database-init.sql:/docker-entrypoint-initdb.d/1-init.sql
118118
- ./local/db/keystone-init.sql:/docker-entrypoint-initdb.d/2-init.sql
119119
networks:
120-
aps-net:
121-
aliases:
122-
- kong-db.localtest.me
120+
- aps-net
123121
kong-migrations:
124122
image: kong:kong-local
125123
command: kong migrations bootstrap
126124
depends_on:
127125
- kong-db
128-
environment: *common-variables
126+
environment:
127+
<<: *common-variables
128+
KONG_DNS_ORDER: 'LAST,A'
129129
networks:
130130
- aps-net
131131
restart: on-failure
@@ -138,7 +138,9 @@ services:
138138
depends_on:
139139
- kong-db
140140
- kong-migrations
141-
environment: *common-variables
141+
environment:
142+
<<: *common-variables
143+
KONG_DNS_ORDER: 'LAST,A'
142144
networks:
143145
- aps-net
144146
restart: on-failure
@@ -150,13 +152,17 @@ services:
150152
- kong-migrations-up
151153
environment:
152154
<<: *common-variables
155+
KONG_DEBUG_LEVEL: debug
153156
KONG_ADMIN_ACCESS_LOG: /dev/stdout
154157
KONG_ADMIN_ERROR_LOG: /dev/stderr
155158
KONG_CASSANDRA_CONTACT_POINTS: kong-db
156159
KONG_NGINX_WORKER_PROCESSES: '1'
157160
KONG_PROXY_ACCESS_LOG: /dev/stdout
158161
KONG_PROXY_ERROR_LOG: /dev/stderr
159162
KONG_ADMIN_LISTEN: 0.0.0.0:8001
163+
KONG_DNS_ORDER: 'LAST,A'
164+
KONG_TRUSTED_IPS: '0.0.0.0/0,::/0'
165+
KONG_REAL_IP_HEADER: X-Forwarded-For
160166
ports:
161167
- 8000:8000
162168
- 8001:8001

local/feeder-init/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ while true; do
3232

3333
else
3434
echo "Waiting for Keycloak....."
35-
sleep 1m
35+
sleep 5
3636
fi
3737
done
File renamed without changes.

local/gwa-api/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ while true; do
6363
break
6464
else
6565
echo "Waiting for Keycloak....."
66-
sleep 1m
66+
sleep 5
6767
fi
6868
done

local/gwa-cli/gw-config.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

local/keycloak/master-realm.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,9 @@
23172317
}
23182318
}
23192319
],
2320-
"defaultClientScopes": [],
2320+
"defaultClientScopes": [
2321+
"profile"
2322+
],
23212323
"optionalClientScopes": []
23222324
},
23232325
{

src/authz/matrix.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ API Owner Role Rules,,,Dataset,read,,,,,api-owner,,,allow,
8787
API Owner Role Rules,,,Environment,create,,active,,,api-owner,,,allow,
8888
API Owner Role Rules,,,Environment,,"update,delete,read",active,,,,,"api-owner,provider-user",allow,
8989
API Owner Role Rules,,forceDeleteEnvironment,,,,,,,api-owner,,,allow,
90+
API Owner Role Rules,,deleteEnvironments,,,,,,,api-owner,,,allow,filterByPackageNS
9091
API Owner Role Rules,,,Environment,read,,,,,,,"api-owner,provider-user",allow,
9192
API Owner Role Rules,,,Environment,create,,,,,api-owner,,,allow,
9293
API Owner Role Rules,,,Environment,update,,,,,api-owner,,,allow,

0 commit comments

Comments
 (0)