Skip to content

Commit 6875490

Browse files
adrianjhuntersliedig
authored andcommitted
chore(ci): Moved samconfig.toml into service folder to simply CLI commands and native Application Builder support
1 parent 0641b62 commit 6875490

File tree

5 files changed

+31
-49
lines changed

5 files changed

+31
-49
lines changed

.gitea/workflows/pipeline.yaml

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ jobs:
235235
236236
- name: Run cfn-lint and cfn-lint-serverless
237237
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
238-
run: cfn-lint contracts-service/template.yaml -a cfn_lint_serverless.rules
239-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
238+
run: cfn-lint template.yaml -a cfn_lint_serverless.rules
239+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/contracts-service
240240

241241
- name: Run Unit Tests
242242
run: uv run pytest tests/unit/
@@ -245,34 +245,26 @@ jobs:
245245
- name: Build and Package Contracts Service
246246
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
247247
run: |
248-
sam build --template contracts-service/template.yaml
248+
sam build
249249
sam package \
250250
--config-env dev \
251251
--output-template-file ".aws-sam/packaged-dev-contracts-service.yaml"
252252
sam package \
253253
--config-env prod \
254254
--output-template-file ".aws-sam/packaged-prod-contracts-service.yaml"
255-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
255+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/contracts-service
256256

257257
- name: Deploy Dev Contracts Service environment
258258
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
259259
run: |
260-
sam deploy \
261-
--config-env dev \
262-
--parameter-overrides Stage=dev \
263-
--no-confirm-changeset \
264-
--no-fail-on-empty-changeset
265-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
260+
sam deploy --config-env dev
261+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/contracts-service
266262

267263
- name: Deploy Prod Contracts Service environment
268264
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
269265
run: |
270-
sam deploy \
271-
--config-env prod \
272-
--parameter-overrides Stage=prod \
273-
--no-confirm-changeset \
274-
--no-fail-on-empty-changeset
275-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
266+
sam deploy --config-env prod
267+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/contracts-service
276268

277269
- name: Deploy Dev ContractsStatusChanged schema
278270
if: ${{ needs.changes.outputs.unicorn_contracts_schema_contractstatuschanged == 'true' }}
@@ -347,8 +339,8 @@ jobs:
347339
348340
- name: Run cfn-lint and cfn-lint-serverless
349341
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
350-
run: cfn-lint approvals-service/template.yaml -a cfn_lint_serverless.rules
351-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
342+
run: cfn-lint template.yaml -a cfn_lint_serverless.rules
343+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
352344

353345
- name: Run Unit Tests
354346
run: uv run pytest tests/unit/
@@ -357,34 +349,26 @@ jobs:
357349
- name: Build and Package Approvals Service
358350
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
359351
run: |
360-
sam build --template approvals-service/template.yaml
352+
sam build
361353
sam package \
362354
--config-env dev \
363355
--output-template-file ".aws-sam/packaged-dev-approvals-service.yaml"
364356
sam package \
365357
--config-env prod \
366358
--output-template-file ".aws-sam/packaged-prod-approvals-service.yaml"
367-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
359+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
368360

369361
- name: Deploy Dev Approvals Service environment
370362
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
371363
run: |
372-
sam deploy \
373-
--config-env dev \
374-
--parameter-overrides Stage=dev \
375-
--no-confirm-changeset \
376-
--no-fail-on-empty-changeset
377-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
364+
sam deploy --config-env dev
365+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
378366

379367
- name: Deploy Prod Approvals Service environment
380368
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
381369
run: |
382-
sam deploy \
383-
--config-env prod \
384-
--parameter-overrides Stage=prod \
385-
--no-confirm-changeset \
386-
--no-fail-on-empty-changeset
387-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
370+
sam deploy --config-env prod
371+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
388372

389373
- name: Deploy Dev PublicationEvaluationCompleted schema
390374
if: ${{ needs.changes.outputs.unicorn_approvals_schema_publicationevaluationcompleted == 'true' }}
@@ -503,8 +487,8 @@ jobs:
503487
504488
- name: Run cfn-lint and cfn-lint-serverless
505489
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
506-
run: cfn-lint web-service/template.yaml -a cfn_lint_serverless.rules
507-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
490+
run: cfn-lint template.yaml -a cfn_lint_serverless.rules
491+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
508492

509493
- name: Run Unit Tests
510494
run: uv run pytest tests/unit/
@@ -513,34 +497,26 @@ jobs:
513497
- name: Build and Package Web Service
514498
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
515499
run: |
516-
sam build --template web-service/template.yaml
500+
sam build
517501
sam package \
518502
--config-env dev \
519503
--output-template-file ".aws-sam/packaged-dev-web-service.yaml"
520504
sam package \
521505
--config-env prod \
522506
--output-template-file ".aws-sam/packaged-prod-web-service.yaml"
523-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
507+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
524508

525509
- name: Deploy Dev Web Service environment
526510
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
527511
run: |
528-
sam deploy \
529-
--config-env dev \
530-
--parameter-overrides Stage=dev \
531-
--no-confirm-changeset \
532-
--no-fail-on-empty-changeset
533-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
512+
sam deploy --config-env dev
513+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
534514

535515
- name: Deploy Prod Web Service environment
536516
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
537517
run: |
538-
sam deploy \
539-
--config-env prod \
540-
--parameter-overrides Stage=prod \
541-
--no-confirm-changeset \
542-
--no-fail-on-empty-changeset
543-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
518+
sam deploy --config-env prod
519+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
544520

545521
- name: Deploy Dev PublicationApprovalRequested schema
546522
if: ${{ needs.changes.outputs.unicorn_web_schema_publicationapprovalrequested == 'true' }}

unicorn_approvals/infrastructure/samconfig.toml renamed to unicorn_approvals/infrastructure/approvals-service/samconfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ resolve_image_repositories = true
4242
[dev.deploy]
4343
[dev.deploy.parameters]
4444
template = ".aws-sam/packaged-dev-approvals-service.yaml"
45+
confirm_changeset = false
4546
fail_on_empty_changeset = false
4647
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
4748
parameter_overrides = "Stage=dev"
@@ -59,6 +60,7 @@ resolve_image_repositories = true
5960
[prod.deploy]
6061
[prod.deploy.parameters]
6162
template = ".aws-sam/packaged-prod-approvals-service.yaml"
63+
confirm_changeset = false
6264
fail_on_empty_changeset = false
6365
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
6466
parameter_overrides = "Stage=prod"

unicorn_contracts/infrastructure/samconfig.toml renamed to unicorn_contracts/infrastructure/contracts-service/samconfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ resolve_image_repositories = true
4242
[dev.deploy]
4343
[dev.deploy.parameters]
4444
template = ".aws-sam/packaged-dev-contracts-service.yaml"
45+
confirm_changeset = false
4546
fail_on_empty_changeset = false
4647
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
4748
parameter_overrides = "Stage=dev"
@@ -59,6 +60,7 @@ resolve_image_repositories = true
5960
[prod.deploy]
6061
[prod.deploy.parameters]
6162
template = ".aws-sam/packaged-prod-contracts-service.yaml"
63+
confirm_changeset = false
6264
fail_on_empty_changeset = false
6365
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
6466
parameter_overrides = "Stage=prod"

unicorn_contracts/infrastructure/contracts-service/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Resources:
8181
ContractEventHandlerFunction:
8282
Type: AWS::Serverless::Function
8383
Properties:
84-
CodeUri: ../src/
84+
CodeUri: ../../src/
8585
Handler: contracts_service.contract_event_handler.lambda_handler
8686
Policies:
8787
- DynamoDBWritePolicy:

unicorn_web/infrastructure/samconfig.toml renamed to unicorn_web/infrastructure/web-service/samconfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ resolve_image_repositories = true
4242
[dev.deploy]
4343
[dev.deploy.parameters]
4444
template = ".aws-sam/packaged-dev-web-service.yaml"
45+
confirm_changeset = false
4546
fail_on_empty_changeset = false
4647
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
4748
parameter_overrides = "Stage=dev"
@@ -59,6 +60,7 @@ resolve_image_repositories = true
5960
[prod.deploy]
6061
[prod.deploy.parameters]
6162
template = ".aws-sam/packaged-prod-web-service.yaml"
63+
confirm_changeset = false
6264
fail_on_empty_changeset = false
6365
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
6466
parameter_overrides = "Stage=prod"

0 commit comments

Comments
 (0)