Skip to content

Commit 4d0c45f

Browse files
Merge pull request #37 from HTTPArchive/development
Single js backend
2 parents c1d1a52 + 43f1fda commit 4d0c45f

File tree

104 files changed

+9207
-2086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+9207
-2086
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "npm"
13+
directory: "/src"
14+
schedule:
15+
interval: "weekly"
16+
- package-ecosystem: "terraform"
17+
directory: "/terraform"
18+
schedule:
19+
interval: "weekly"

.github/workflows/pipeline.yaml

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ name: Tech Report API Pipeline
33
on: [push]
44

55
env:
6-
PIPELINE_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
76
PIPELINE_SA_KEY: ${{ secrets.GCP_SA_KEY }}
8-
PIPELINE_PROJECT_DATABASE_DEV: ${{ secrets.GCP_PROJECT_DATABASE_DEV }}
9-
PIPELINE_PROJECT_DATABASE_PROD: ${{ secrets.GCP_PROJECT_DATABASE_PROD }}
107
PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS: ${{ secrets.GCP_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}
118
PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY: ${{ secrets.GCP_SERVICE_ACCOUNT_API_GATEWAY }}
129

@@ -15,18 +12,10 @@ jobs:
1512
runs-on: ubuntu-latest
1613
steps:
1714
- uses: actions/checkout@v3
18-
- name: Set up Python 3.10
19-
uses: actions/setup-python@v3
20-
with:
21-
python-version: "3.10"
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
python -m pip install pytest
26-
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
27-
- name: Test with pytest
28-
run: |
29-
python -m pytest -W "ignore"
15+
- run: |
16+
cd src
17+
npm ci
18+
npm run test
3019
3120
deploy_development:
3221
if: github.ref == 'refs/heads/development'
@@ -40,30 +29,29 @@ jobs:
4029
- name: Google Cloud Auth
4130
uses: 'google-github-actions/auth@v2'
4231
with:
43-
project_id: ${{ env.PIPELINE_PROJECT_ID }}
32+
project_id: 'httparchive'
4433
credentials_json: ${{ env.PIPELINE_SA_KEY }}
4534

4635
- uses: hashicorp/setup-terraform@v3
47-
36+
4837
- name: Terraform fmt
4938
id: fmt
5039
run: terraform fmt -check
5140
continue-on-error: true
52-
41+
5342
- name: Terraform Init
5443
id: init
5544
run: terraform init
56-
45+
5746
- name: Terraform Validate
5847
id: validate
5948
run: terraform validate -no-color
60-
49+
6150
- name: Terraform Plan
6251
id: plan
6352
run: |
6453
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
65-
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
66-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}"
54+
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
6755
continue-on-error: true
6856

6957
- name: Terraform Plan status
@@ -75,9 +63,8 @@ jobs:
7563
run: |
7664
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
7765
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
78-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" \
7966
-auto-approve
80-
67+
8168
deploy_production:
8269
if: github.ref == 'refs/heads/main'
8370
runs-on: ubuntu-latest
@@ -90,30 +77,29 @@ jobs:
9077
- name: Google Cloud Auth
9178
uses: 'google-github-actions/auth@v2'
9279
with:
93-
project_id: ${{ env.PIPELINE_PROJECT_ID }}
80+
project_id: 'httparchive'
9481
credentials_json: ${{ env.PIPELINE_SA_KEY }}
9582

9683
- uses: hashicorp/setup-terraform@v3
97-
84+
9885
- name: Terraform fmt
9986
id: fmt
10087
run: terraform fmt -check
10188
continue-on-error: true
102-
89+
10390
- name: Terraform Init
10491
id: init
10592
run: terraform init
106-
93+
10794
- name: Terraform Validate
10895
id: validate
10996
run: terraform validate -no-color
110-
97+
11198
- name: Terraform Plan
11299
id: plan
113100
run: |
114101
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
115-
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
116-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}"
102+
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
117103
continue-on-error: true
118104

119105
- name: Terraform Plan status
@@ -125,7 +111,5 @@ jobs:
125111
run: |
126112
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
127113
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
128-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}" \
129114
-auto-approve
130-
131-
115+

.gitignore

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ spec.yaml
2424
# CLI
2525
.DS_Store
2626

27-
# asdf
28-
/.tool-versions
2927

30-
# python
31-
__pycache__
32-
.pytest_cache
33-
.venv
34-
35-
utils.txt
36-
logs
28+
node_modules/
29+
src/coverage/

0 commit comments

Comments
 (0)