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

ci: ensure unique Docker image is built #7

Merged
merged 7 commits into from
Aug 10, 2024
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ jobs:
npm run ory:generate:kratos -- -e .env.ci
npm run ory:generate:keto -- -e .env.ci

- run: npx nx run cat-fostering-api:docker-build --no-agents
- run: echo "DOCKER_API_TAG=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV

- run: npx nx run cat-fostering-api:container --skip-nx-cache --no-agents --platforms=linux/amd64 --load=true --push=false --tags='ghcr.io/getlarge/cat-fostering/cat-fostering-api:${{ env.DOCKER_API_TAG }}'

# can't use --wait --wait-timeout N options since Keto and Kratos migrate containers will exit before the Keto and Kratos services are ready
- run: npx @dotenvx/dotenvx run -- docker compose --profile ci -p cat-fostering up -d
env:
DOCKER_API_TAG: ${{ env.DOCKER_API_TAG }}

- run: sleep 10

Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ -n "$CI" ] && exit 0
npx lint-staged --concurrent false --relative
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.ts": ["nx affected:lint --fix --files"],
"*": ["npx nx format:write --files"]
}
264 changes: 132 additions & 132 deletions .vscode/thunder-tests/collections/tc_col_cat-fostering.json
Original file line number Diff line number Diff line change
@@ -1,138 +1,138 @@
{
"_id": "68f2794f-94c6-4be1-847f-46cc09aef587",
"colName": "CatFostering",
"created": "2024-05-19T19:03:45.980Z",
"sortNum": 10000,
"folders": [],
"requests": [
"_id": "68f2794f-94c6-4be1-847f-46cc09aef587",
"colName": "CatFostering",
"created": "2024-05-19T19:03:45.980Z",
"sortNum": 10000,
"folders": [],
"requests": [
{
"_id": "75c7aff3-5a3e-4085-aa4f-e5fa78308a68",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "GET current-user",
"url": "/api/users/current-user",
"method": "GET",
"sortNum": 10000,
"created": "2024-05-19T19:05:21.811Z",
"modified": "2024-05-19T19:17:00.791Z",
"headers": []
},
{
"_id": "c92cb441-f570-45ab-8a46-e1be1c88b323",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "POST cat-profiles",
"url": "/api/cat-profiles",
"method": "POST",
"sortNum": 20000,
"created": "2024-05-19T19:07:50.514Z",
"modified": "2024-05-19T19:56:31.801Z",
"headers": [],
"body": {
"type": "json",
"raw": "{\n \"name\": \"Romeo\",\n \"description\": \"Romeo is a very playful cat, he loves to play with curtains and sleep on the couch.\",\n \"age\": 2\n}",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "719143af-9033-4fb9-9e4d-d3f309ea4fde",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "PATCH cat-profiles/:id",
"url": "/api/cat-profiles/{catProfileId}",
"method": "PATCH",
"sortNum": 30000,
"created": "2024-05-19T19:10:10.851Z",
"modified": "2024-05-19T19:59:38.045Z",
"headers": [],
"params": [
{
"_id": "75c7aff3-5a3e-4085-aa4f-e5fa78308a68",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "GET current-user",
"url": "/api/users/current-user",
"method": "GET",
"sortNum": 10000,
"created": "2024-05-19T19:05:21.811Z",
"modified": "2024-05-19T19:17:00.791Z",
"headers": []
},
{
"_id": "c92cb441-f570-45ab-8a46-e1be1c88b323",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "POST cat-profiles",
"url": "/api/cat-profiles",
"method": "POST",
"sortNum": 20000,
"created": "2024-05-19T19:07:50.514Z",
"modified": "2024-05-19T19:56:31.801Z",
"headers": [],
"body": {
"type": "json",
"raw": "{\n \"name\": \"Romeo\",\n \"description\": \"Romeo is a very playful cat, he loves to play with curtains and sleep on the couch.\",\n \"age\": 2\n}",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "719143af-9033-4fb9-9e4d-d3f309ea4fde",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "PATCH cat-profiles/:id",
"url": "/api/cat-profiles/{catProfileId}",
"method": "PATCH",
"sortNum": 30000,
"created": "2024-05-19T19:10:10.851Z",
"modified": "2024-05-19T19:59:38.045Z",
"headers": [],
"params": [
{
"name": "catProfileId",
"value": "{{user1CatProfileId}}",
"isPath": true
}
],
"body": {
"type": "json",
"raw": "{\n \"age\": 4\n}",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "8360df1f-1907-47e6-9306-bf78eb2950be",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "POST fostering",
"url": "/api/fostering",
"method": "POST",
"sortNum": 40000,
"created": "2024-05-19T19:11:13.012Z",
"modified": "2024-05-19T19:24:11.344Z",
"headers": [],
"body": {
"type": "json",
"raw": "{\n \"catProfileId\": \"{{user1CatProfileId}}\",\n \"startDate\": \"2023-12-01\",\n \"endDate\": \"2023-12-07\"\n }",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "733d1f15-2637-48a3-8f95-fb9bdbad2a6d",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "GET fostering/:id",
"url": "/api/fostering/{fosteringId}",
"method": "GET",
"sortNum": 50000,
"created": "2024-05-19T19:13:22.742Z",
"modified": "2024-05-19T19:25:16.059Z",
"headers": [],
"params": [
{
"name": "fosteringId",
"value": "{{user2FosteringId}}",
"isPath": true
}
]
},
"name": "catProfileId",
"value": "{{user1CatProfileId}}",
"isPath": true
}
],
"body": {
"type": "json",
"raw": "{\n \"age\": 4\n}",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "8360df1f-1907-47e6-9306-bf78eb2950be",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "POST fostering",
"url": "/api/fostering",
"method": "POST",
"sortNum": 40000,
"created": "2024-05-19T19:11:13.012Z",
"modified": "2024-05-19T19:24:11.344Z",
"headers": [],
"body": {
"type": "json",
"raw": "{\n \"catProfileId\": \"{{user1CatProfileId}}\",\n \"startDate\": \"2023-12-01\",\n \"endDate\": \"2023-12-07\"\n }",
"form": []
},
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
}
},
{
"_id": "733d1f15-2637-48a3-8f95-fb9bdbad2a6d",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "GET fostering/:id",
"url": "/api/fostering/{fosteringId}",
"method": "GET",
"sortNum": 50000,
"created": "2024-05-19T19:13:22.742Z",
"modified": "2024-05-19T19:25:16.059Z",
"headers": [],
"params": [
{
"_id": "c80cd784-6357-4c55-84cd-69922d916146",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "PATCH approve fostering/:id",
"url": "/api/fostering/{fosteringId}/approve",
"method": "PATCH",
"sortNum": 60000,
"created": "2024-05-19T19:14:02.538Z",
"modified": "2024-05-19T19:27:01.544Z",
"headers": [],
"params": [
{
"name": "fosteringId",
"value": "{{user2FosteringId}}",
"isPath": true
}
]
"name": "fosteringId",
"value": "{{user2FosteringId}}",
"isPath": true
}
],
"settings": {
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
},
"options": {
"baseUrl": "{{baseUrl}}"
]
},
{
"_id": "c80cd784-6357-4c55-84cd-69922d916146",
"colId": "68f2794f-94c6-4be1-847f-46cc09aef587",
"containerId": "",
"name": "PATCH approve fostering/:id",
"url": "/api/fostering/{fosteringId}/approve",
"method": "PATCH",
"sortNum": 60000,
"created": "2024-05-19T19:14:02.538Z",
"modified": "2024-05-19T19:27:01.544Z",
"headers": [],
"params": [
{
"name": "fosteringId",
"value": "{{user2FosteringId}}",
"isPath": true
}
]
}
],
"settings": {
"auth": {
"type": "bearer",
"bearer": "{{orySessionToken}}"
},
"options": {
"baseUrl": "{{baseUrl}}"
}
}
}
}
92 changes: 46 additions & 46 deletions .vscode/thunder-tests/environments/tc_env_cat-fostering-demo.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"_id": "11d9d233-af83-41c6-9dce-0afe40547244",
"name": "CatFostering Demo",
"default": true,
"sortNum": 20000,
"created": "2024-05-19T19:39:54.612Z",
"modified": "2024-05-19T19:39:54.612Z",
"data": [
{
"name": "baseUrl",
"value": "http://localhost:3000"
},
{
"name": "orySessionToken",
"value": ""
},
{
"name": "user1Id",
"value": ""
},
{
"name": "user1CatProfileId",
"value": ""
},
{
"name": "user2Id",
"value": ""
},
{
"name": "user2FosteringId",
"value": ""
},
{
"name": "orySessionToken1",
"value": ""
},
{
"name": "orySessionToken2",
"value": ""
},
{
"name": "orySessionToken3",
"value": ""
}
],
"envFile": "../../.env.demo.thunderclient"
}
"_id": "11d9d233-af83-41c6-9dce-0afe40547244",
"name": "CatFostering Demo",
"default": false,
"sortNum": 20000,
"created": "2024-05-19T19:39:54.612Z",
"modified": "2024-05-19T19:39:54.612Z",
"data": [
{
"name": "baseUrl",
"value": "http://localhost:3000"
},
{
"name": "orySessionToken",
"value": ""
},
{
"name": "user1Id",
"value": ""
},
{
"name": "user1CatProfileId",
"value": ""
},
{
"name": "user2Id",
"value": ""
},
{
"name": "user2FosteringId",
"value": ""
},
{
"name": "orySessionToken1",
"value": ""
},
{
"name": "orySessionToken2",
"value": ""
},
{
"name": "orySessionToken3",
"value": ""
}
],
"envFile": "../../.env.demo.thunderclient"
}
Loading