Skip to content

Commit 710f2ec

Browse files
committed
chore(ci): Moved samconfig.toml into service folder to simply CLI commands and native Application Builder support
1 parent cd9cb96 commit 710f2ec

File tree

4 files changed

+30
-48
lines changed

4 files changed

+30
-48
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
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
@@ -246,34 +246,26 @@ jobs:
246246
- name: Build and Package Contracts Service
247247
if: ${{ needs.changes.outputs.unicorn_contracts_service == 'true' }}
248248
run: |
249-
sam build --template contracts-service/template.yaml
249+
sam build
250250
sam package \
251251
--config-env dev \
252252
--output-template-file ".aws-sam/packaged-dev-contracts-service.yaml"
253253
sam package \
254254
--config-env prod \
255255
--output-template-file ".aws-sam/packaged-prod-contracts-service.yaml"
256-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
256+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/contracts-service
257257

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

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

278270
- name: Deploy Dev ContractsStatusChanged schema
279271
if: ${{ needs.changes.outputs.unicorn_contracts_schema_contractstatuschanged == 'true' }}
@@ -348,8 +340,8 @@ jobs:
348340
349341
- name: Run cfn-lint and cfn-lint-serverless
350342
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
351-
run: cfn-lint approvals-service/template.yaml -a cfn_lint_serverless.rules
352-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
343+
run: cfn-lint template.yaml -a cfn_lint_serverless.rules
344+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
353345

354346
- name: Run Unit Tests
355347
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
@@ -359,34 +351,26 @@ jobs:
359351
- name: Build and Package Approvals Service
360352
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
361353
run: |
362-
sam build --template approvals-service/template.yaml
354+
sam build
363355
sam package \
364356
--config-env dev \
365357
--output-template-file ".aws-sam/packaged-dev-approvals-service.yaml"
366358
sam package \
367359
--config-env prod \
368360
--output-template-file ".aws-sam/packaged-prod-approvals-service.yaml"
369-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
361+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
370362

371363
- name: Deploy Dev Approvals Service environment
372364
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
373365
run: |
374-
sam deploy \
375-
--config-env dev \
376-
--parameter-overrides Stage=dev \
377-
--no-confirm-changeset \
378-
--no-fail-on-empty-changeset
379-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
366+
sam deploy --config-env dev
367+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
380368

381369
- name: Deploy Prod Approvals Service environment
382370
if: ${{ needs.changes.outputs.unicorn_approvals_service == 'true' }}
383371
run: |
384-
sam deploy \
385-
--config-env prod \
386-
--parameter-overrides Stage=prod \
387-
--no-confirm-changeset \
388-
--no-fail-on-empty-changeset
389-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
372+
sam deploy --config-env prod
373+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/approvals-service
390374

391375
- name: Deploy Dev PublicationEvaluationCompleted schema
392376
if: ${{ needs.changes.outputs.unicorn_approvals_schema_publicationevaluationcompleted == 'true' }}
@@ -505,40 +489,32 @@ jobs:
505489
506490
- name: Run cfn-lint and cfn-lint-serverless
507491
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
508-
run: cfn-lint web-service/template.yaml -a cfn_lint_serverless.rules
509-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
492+
run: cfn-lint template.yaml -a cfn_lint_serverless.rules
493+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
510494

511495
- name: Build and Package Web Service
512496
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
513497
run: |
514-
sam build --template web-service/template.yaml
498+
sam build
515499
sam package \
516500
--config-env dev \
517501
--output-template-file ".aws-sam/packaged-dev-web-service.yaml"
518502
sam package \
519503
--config-env prod \
520504
--output-template-file ".aws-sam/packaged-prod-web-service.yaml"
521-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
505+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
522506

523507
- name: Deploy Dev Web Service environment
524508
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
525509
run: |
526-
sam deploy \
527-
--config-env dev \
528-
--parameter-overrides Stage=dev \
529-
--no-confirm-changeset \
530-
--no-fail-on-empty-changeset
531-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
510+
sam deploy --config-env dev
511+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
532512

533513
- name: Deploy Prod Web Service environment
534514
if: ${{ needs.changes.outputs.unicorn_web_service == 'true' }}
535515
run: |
536-
sam deploy \
537-
--config-env prod \
538-
--parameter-overrides Stage=prod \
539-
--no-confirm-changeset \
540-
--no-fail-on-empty-changeset
541-
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure
516+
sam deploy --config-env prod
517+
working-directory: ${{ gitea.workspace }}/${{ env.SERVICE_FOLDER }}/infrastructure/web-service
542518

543519
- name: Deploy Dev PublicationApprovalRequested schema
544520
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_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)