Skip to content

Commit 7ec9f10

Browse files
zhijiezhijie
authored andcommitted
revised code to use Postgres
0 parents  commit 7ec9f10

File tree

103 files changed

+51751
-0
lines changed

Some content is hidden

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

103 files changed

+51751
-0
lines changed

.circleci/config.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
version: 2
2+
defaults: &defaults
3+
docker:
4+
- image: cimg/python:3.12.1-browsers
5+
install_dependency: &install_dependency
6+
name: Installation of build and deployment dependencies.
7+
command: |
8+
pip3 install awscli --upgrade
9+
install_deploysuite: &install_deploysuite
10+
name: Installation of install_deploysuite.
11+
command: |
12+
git clone --branch v1.4.17 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
13+
cp ./../buildscript/master_deploy.sh .
14+
cp ./../buildscript/buildenv.sh .
15+
cp ./../buildscript/awsconfiguration.sh .
16+
17+
restore_cache_settings_for_build: &restore_cache_settings_for_build
18+
key: docker-node-modules-{{ checksum "yarn.lock" }}
19+
20+
save_cache_settings: &save_cache_settings
21+
key: docker-node-modules-{{ checksum "yarn.lock" }}
22+
paths:
23+
- node_modules
24+
25+
builddeploy_steps: &builddeploy_steps
26+
- checkout
27+
- setup_remote_docker
28+
- run: *install_dependency
29+
- run: *install_deploysuite
30+
- restore_cache: *restore_cache_settings_for_build
31+
- run:
32+
name: "Authenticate with CodeArtifact and build Docker image"
33+
command: |
34+
./awsconfiguration.sh ${CODEARTIFACT_ENV}
35+
source awsenvconf
36+
aws codeartifact login --tool npm --repository topcoder-framework --domain topcoder --domain-owner $AWS_ACCOUNT_ID --region $AWS_REGION --namespace @topcoder-framework
37+
cp ~/.npmrc .
38+
rm -f awsenvconf
39+
./build.sh ${APPNAME}
40+
- save_cache: *save_cache_settings
41+
- deploy:
42+
name: Running MasterScript.
43+
command: |
44+
./awsconfiguration.sh $DEPLOY_ENV
45+
source awsenvconf
46+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
47+
source buildenvvar
48+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME} -p FARGATE
49+
jobs:
50+
# Build & Deploy against development backend
51+
"build-dev":
52+
!!merge <<: *defaults
53+
environment:
54+
DEPLOY_ENV: "DEV"
55+
LOGICAL_ENV: "dev"
56+
APPNAME: "challenge-api"
57+
CODEARTIFACT_ENV: "PROD"
58+
steps: *builddeploy_steps
59+
60+
"build-qa":
61+
!!merge <<: *defaults
62+
environment:
63+
DEPLOY_ENV: "QA"
64+
LOGICAL_ENV: "qa"
65+
APPNAME: "challenge-api"
66+
CODEARTIFACT_ENV: "PROD"
67+
steps: *builddeploy_steps
68+
69+
"build-prod":
70+
!!merge <<: *defaults
71+
environment:
72+
DEPLOY_ENV: "PROD"
73+
LOGICAL_ENV: "prod"
74+
APPNAME: "challenge-api"
75+
CODEARTIFACT_ENV: "PROD"
76+
steps: *builddeploy_steps
77+
78+
workflows:
79+
version: 2
80+
build:
81+
jobs:
82+
# Development builds are executed on "develop" branch only.
83+
- "build-dev":
84+
context: org-global
85+
filters:
86+
branches:
87+
only:
88+
- dev
89+
- feature/top-262-projectid-non-mandatory
90+
- TOP-2364
91+
92+
- "build-qa":
93+
context: org-global
94+
filters:
95+
branches:
96+
only:
97+
- qa
98+
99+
# Production builds are exectuted only on tagged commits to the
100+
# master branch.
101+
- "build-prod":
102+
context: org-global
103+
filters:
104+
branches:
105+
only: master

.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: standard

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
.yarn
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25+
.grunt
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (https://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
40+
# TypeScript v1 declaration files
41+
typings/
42+
43+
# Optional npm cache directory
44+
.npm
45+
46+
# Optional eslint cache
47+
.eslintcache
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# Yarn Integrity file
56+
.yarn-integrity
57+
58+
# dotenv environment variables file
59+
.env
60+
.env*
61+
62+
# next.js build output
63+
.next
64+
ecr-login.sh
65+
.npmrc
66+
test.js

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.19.0

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 100
3+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"standard.autoFixOnSave": true,
3+
"[javascript]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
}
6+
}

0 commit comments

Comments
 (0)