-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from undp/containerize-v1
Containerize v1
- Loading branch information
Showing
240 changed files
with
2,669 additions
and
1,415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
- develop | ||
- main | ||
paths: | ||
- lambda/** | ||
- backend/** | ||
- libs/** | ||
|
||
env: | ||
|
@@ -24,7 +24,7 @@ jobs: | |
fetch-depth: 0 | ||
- id: check_file_changed | ||
run: | | ||
if [[ $(git diff --name-only HEAD^ HEAD | grep lambda/services/package.json) ]] || [[ $(git diff --name-only HEAD^ HEAD | grep libs/) ]]; then | ||
if [[ $(git diff --name-only HEAD^ HEAD | grep backend/services/package.json) ]] || [[ $(git diff --name-only HEAD^ HEAD | grep libs/) ]]; then | ||
echo "deps_changed=True" >> $GITHUB_OUTPUT | ||
else | ||
echo "deps_changed=False" >> $GITHUB_OUTPUT | ||
|
@@ -54,29 +54,29 @@ jobs: | |
run: yarn run build | ||
- name: Copy package.json | ||
if: ${{ needs.check_dependency_change.outputs.deps_changed == 'True' }} | ||
working-directory: ./lambda/layer/dependency_layer | ||
working-directory: ./backend/layer/dependency_layer | ||
run: cp ../../services/package.json ./ && cp ../../services/yarn.lock ./ && cp -r ../../../libs ../../ | ||
- name: Install Dependency | ||
if: ${{ needs.check_dependency_change.outputs.deps_changed == 'True' }} | ||
working-directory: ./lambda/layer/dependency_layer | ||
working-directory: ./backend/layer/dependency_layer | ||
run: yarn install --production --frozen-lockfile | ||
# - name: Copy Dependency | ||
# if: ${{ needs.check_dependency_change.outputs.deps_changed == 'True' }} | ||
# working-directory: ./lambda/layer | ||
# working-directory: ./backend/layer | ||
# run: | | ||
# cp -r node_modules ./dependency_layer | ||
# ls | ||
- name: serverless deploy develop | ||
if: ${{ needs.check_dependency_change.outputs.deps_changed == 'True' && github.ref == 'refs/heads/develop'}} | ||
uses: serverless/[email protected] | ||
with: | ||
args: -c "cd ./lambda/layer && serverless deploy --stage dev" | ||
args: -c "cd ./backend/layer && serverless deploy --stage dev" | ||
entrypoint: /bin/sh | ||
- name: serverless deploy main | ||
if: ${{ needs.check_dependency_change.outputs.deps_changed == 'True' && github.ref == 'refs/heads/main'}} | ||
uses: serverless/[email protected] | ||
with: | ||
args: -c "cd ./lambda/layer && serverless deploy --stage prod" | ||
args: -c "cd ./backend/layer && serverless deploy --stage prod" | ||
entrypoint: /bin/sh | ||
deploy: | ||
name: deploy | ||
|
@@ -89,7 +89,7 @@ jobs: | |
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Dependency | ||
working-directory: ./lambda/services | ||
working-directory: ./backend/services | ||
run: yarn install --frozen-lockfile | ||
- name: version | ||
run: | | ||
|
@@ -106,13 +106,13 @@ jobs: | |
if: github.ref == 'refs/heads/develop' | ||
uses: serverless/[email protected] | ||
with: | ||
args: -c "cd ./lambda/services && serverless deploy --stage dev --param='depLayerArn1=${{ steps.layerArn.outputs.ARN1 }}' --param='depLayerArn2=${{ steps.layerArn.outputs.ARN2 }}'" | ||
args: -c "cd ./backend/services && serverless deploy --stage dev --param='depLayerArn1=${{ steps.layerArn.outputs.ARN1 }}' --param='depLayerArn2=${{ steps.layerArn.outputs.ARN2 }}'" | ||
entrypoint: /bin/sh | ||
- name: serverless deploy main | ||
if: github.ref == 'refs/heads/main' | ||
uses: serverless/[email protected] | ||
with: | ||
args: -c "cd ./lambda/services && serverless deploy --stage prod" | ||
args: -c "cd ./backend/services && serverless deploy --stage prod" | ||
entrypoint: /bin/sh | ||
|
||
# automated-api-tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,11 @@ STAGE=dev | |
DB_HOST=carbondb.caslz2nn5xor.us-east-1.rds.amazonaws.com | ||
DB_PORT=5432 | ||
DB_USER=root | ||
DB_PASSWORD=abcd1234 | ||
DB_NAME=carbondbdev | ||
LOG_LEVEL=debug | ||
carbon_dev_common=carbon-www-common | ||
SOURCE_EMAIL=[email protected] | ||
SOURCE_EMAIL=[email protected] | ||
IS_EMAIL_DISABLED=true | ||
LEDGER_TYPE=QLDB | ||
FILE_SERVICE=S3 | ||
LOCATION_SERVICE=MAPBOX |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Base image | ||
FROM node:16-alpine | ||
|
||
# Create app directory | ||
WORKDIR /app/backend/services | ||
|
||
COPY ./backend/services/package.json ./ | ||
COPY ./backend/services/yarn.lock ./ | ||
|
||
COPY ./libs ../../libs | ||
|
||
# Install app dependencies | ||
RUN yarn run sls:installProd | ||
|
||
# Bundle app source | ||
COPY ./backend/services . | ||
|
||
ENV NODE_ENV production | ||
RUN yarn add @nestjs/cli --dev && yarn run build && yarn remove @nestjs/cli && yarn cache clean | ||
|
||
# Start the server using the production build | ||
CMD [ "node", "dist/main.js" ] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Static file locations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Name,Country,Latitude,Longitude | ||
Abia,Nigeria,5.454095299,7.5153071 | ||
Adamawa,Nigeria,9.512977199,12.3881887 | ||
Akwa Ibom,Nigeria,4.9408638,7.8412267 | ||
Anambra,Nigeria,6.218313599,6.9531842 | ||
Bauchi,Nigeria,10.6228284,10.0287754 | ||
Bayelsa,Nigeria,4.7629786,6.028898 | ||
Benue,Nigeria,7.350574699,8.7772877 | ||
Borno,Nigeria,12.1875392,13.3080034 | ||
Cross River,Nigeria,5.867196599,8.5204774 | ||
Delta,Nigeria,5.527306099,6.1784167 | ||
Ebonyi,Nigeria,6.199691799,8.0348906 | ||
Edo,Nigeria,6.607657499,5.9722713 | ||
Ekiti,Nigeria,7.736890999,5.2738326 | ||
Enugu,Nigeria,6.553609399,7.4143061 | ||
Federal Capital Territory,Nigeria,8.831122799,7.1724673 | ||
Gombe,Nigeria,10.38301,11.206567 | ||
Imo,Nigeria,5.585945599,7.0669651 | ||
Jigawa,Nigeria,12.3252362,9.5103296 | ||
Kaduna,Nigeria,10.3825318,7.8533226 | ||
Kano,Nigeria,11.8948389,8.5364136 | ||
Katsina,Nigeria,12.5630825,7.6207063 | ||
Kebbi,Nigeria,11.4167574,4.1074545 | ||
Kogi,Nigeria,7.794960199,6.6868669 | ||
Kwara,Nigeria,8.836789099,4.6688487 | ||
Lagos,Nigeria,6.526903299,3.5774005 | ||
Nasarawa,Nigeria,8.438786799,8.2382849 | ||
Niger,Nigeria,9.932608299,5.6511088 | ||
Ogun,Nigeria,6.978858199,3.4389293 | ||
Ondo,Nigeria,7.020968599,5.0567477 | ||
Osun,Nigeria,7.548404699,4.4978307 | ||
Oyo,Nigeria,8.215124899,3.5642897 | ||
Plateau,Nigeria,9.058344599,9.6826289 | ||
Rivers,Nigeria,4.8416028,6.8604088 | ||
Sokoto,Nigeria,13.0611195,5.3152203 | ||
Taraba,Nigeria,8.014133399,10.7376336 | ||
Yobe,Nigeria,12.1233242,11.5065937 | ||
Zamfara,Nigeria,12.0078998,6.4191432 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.