Skip to content

Commit 446dd68

Browse files
add rest of files
1 parent bf9c008 commit 446dd68

20 files changed

+21291
-0
lines changed

.github/workflows/cicd.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy webapp
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
terraform-validate:
15+
name: 'Terraform'
16+
env:
17+
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
18+
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
19+
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
20+
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
21+
runs-on: ubuntu-latest
22+
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
steps:
28+
- name: Add profile credentials to ~/.aws/credentials
29+
run: |
30+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile ${{ env.AWS_PROFILE_NAME }}"
31+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile ${{ env.AWS_PROFILE_NAME }}"
32+
aws configure set region ${{ env.AWS_REGION }} --profile ${{ env.AWS_PROFILE_NAME }}"
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 18.10.0
38+
39+
- name: Setup Angular CLI
40+
run: npm install -g @angular/cli > /dev/null
41+
42+
- name: Setup Terraform
43+
uses: hashicorp/setup-terraform@v2
44+
45+
- name: Terraform Init
46+
run: terraform -chdir=./infrastructure init -backend-config=./config/backend.conf
47+
48+
- name: Terraform Format
49+
run: terraform -chdir=./infrastructure fmt -recursive -check
50+
51+
- name: Terraform Plan
52+
run: terraform -chdir=./entrypoint plan -var "aws_region=${{ env.AWS_REGION }}" -var "aws_profile=${{ env.AWS_PROFILE_NAME }}" -var "app_name=${{ env.APP_NAME }}" -var "certificate_arn=${{ secrets.AWS_CERTIFICATE_ARN }}" -var "domain_name=${{ env.DOMAIN_NAME }}"
53+
54+
- name: Terraform Apply
55+
run: terraform -chdir=./entrypoint apply -auto-approve -var "aws_region=${{ env.AWS_REGION }}" -var "aws_profile=${{ env.AWS_PROFILE_NAME }}" -var "app_name=${{ env.APP_NAME }}" -var "certificate_arn=${{ secrets.CERTIFICATE_ARN }}" -var "domain_name=${{ env.DOMAIN_NAME }}"

.gitignore

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/.idea/
2+
/.idea/*
3+
4+
/.vscode/*
5+
.vscode/*
6+
!.vscode/settings.json
7+
!.vscode/tasks.json
8+
!.vscode/launch.json
9+
!.vscode/extensions.json
10+
!.vscode/*.code-snippets
11+
12+
# Local History for Visual Studio Code
13+
.history/
14+
15+
# Built Visual Studio Code Extensions
16+
*.vsix
17+
18+
# Local .terraform directories
19+
**/.terraform/*
20+
**/.terraform
21+
.terraform.lock.hcl
22+
23+
# .tfstate files
24+
*.tfstate
25+
*.tfstate.*
26+
27+
# Crash log files
28+
crash.log
29+
crash.*.log
30+
31+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
32+
# password, private keys, and other secrets. These should not be part of version
33+
# control as they are data points which are potentially sensitive and subject
34+
# to change depending on the environment.
35+
*.tfvars.json
36+
37+
# Ignore override files as they are usually used to override resources locally and so
38+
# are not checked in
39+
override.tf
40+
override.tf.json
41+
*_override.tf
42+
*_override.tf.json
43+
44+
# Ignore CLI configuration files
45+
.terraformrc
46+
terraform.rc
47+
48+
.tmp
49+
50+
.DS_Store
51+
terraform.tfvars
52+
53+
54+
55+
/source-code/.angular/
56+
/source-code/.vscode/
57+
/source-code/dist/
58+
/source-code/node_modules/

source-code/.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

source-code/angular.json

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"source-code": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "less"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/source-code",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": [
24+
"zone.js"
25+
],
26+
"tsConfig": "tsconfig.app.json",
27+
"inlineStyleLanguage": "less",
28+
"assets": [
29+
"src/favicon.ico",
30+
"src/assets"
31+
],
32+
"styles": [
33+
"src/styles.less"
34+
],
35+
"scripts": []
36+
},
37+
"configurations": {
38+
"production": {
39+
"budgets": [
40+
{
41+
"type": "initial",
42+
"maximumWarning": "500kb",
43+
"maximumError": "1mb"
44+
},
45+
{
46+
"type": "anyComponentStyle",
47+
"maximumWarning": "2kb",
48+
"maximumError": "4kb"
49+
}
50+
],
51+
"outputHashing": "all"
52+
},
53+
"development": {
54+
"buildOptimizer": false,
55+
"optimization": false,
56+
"vendorChunk": true,
57+
"extractLicenses": false,
58+
"sourceMap": true,
59+
"namedChunks": true
60+
}
61+
},
62+
"defaultConfiguration": "production"
63+
},
64+
"serve": {
65+
"builder": "@angular-devkit/build-angular:dev-server",
66+
"configurations": {
67+
"production": {
68+
"browserTarget": "source-code:build:production"
69+
},
70+
"development": {
71+
"browserTarget": "source-code:build:development"
72+
}
73+
},
74+
"defaultConfiguration": "development"
75+
},
76+
"extract-i18n": {
77+
"builder": "@angular-devkit/build-angular:extract-i18n",
78+
"options": {
79+
"browserTarget": "source-code:build"
80+
}
81+
},
82+
"test": {
83+
"builder": "@angular-devkit/build-angular:karma",
84+
"options": {
85+
"polyfills": [
86+
"zone.js",
87+
"zone.js/testing"
88+
],
89+
"tsConfig": "tsconfig.spec.json",
90+
"inlineStyleLanguage": "less",
91+
"assets": [
92+
"src/favicon.ico",
93+
"src/assets"
94+
],
95+
"styles": [
96+
"src/styles.less"
97+
],
98+
"scripts": []
99+
}
100+
}
101+
}
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)