Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Initial Commit #323

Merged
merged 21 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
83 changes: 58 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,30 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
name: Access npm folder as root
command: cd $(npm root -g)/npm
- run:
name: Update NPM install (using `npm ci`)
command: npm ci
- run:
name: Delete build dependencies
command: apk del build-dependencies
# - run:
# name: Access npm folder as root
# command: cd $(npm root -g)/npm
# - run:
# name: Update NPM install (using `npm ci`)
# command: npm ci
####################################################
- run:
name: Install Dependencies
command: yarn install --immutable
- save_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- .yarn/cache
- .yarn/unplugged
- node_modules

####################################################

- run:
name: Delete build dependencies
command: apk del build-dependencies

test-unit:
executor: default-docker
steps:
Expand All @@ -105,10 +115,15 @@ jobs:
command: *defaults_Dependencies
- checkout
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --immutable
- run:
name: Execute unit tests
command: npm run test
command: yarn run test:unit
- store_test_results:
path: /home/circleci/project/
- store_artifacts:
Expand All @@ -125,7 +140,9 @@ jobs:
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Set up NVM
command: |
Expand All @@ -151,8 +168,8 @@ jobs:
name: Execute integration tests
command: |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
npm ci
npm run test:int
yarn install --immutable
yarn run test:int
- run:
name: prepare test/results
command: |
Expand All @@ -171,10 +188,12 @@ jobs:
command: *defaults_Dependencies
- checkout
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Execute unit tests
command: npm run build:openapi && npm run validate:api
command: yarn run build:openapi && yarn run validate:api

lint:
executor: default-docker
Expand All @@ -184,13 +203,19 @@ jobs:
command: *defaults_Dependencies
- checkout
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install --immutable

- run:
name: Create dir for lint results
command: mkdir -p /lintresults
- run:
name: Execute linting
command: (npm run lint > /lintresults/results.txt)
command: (yarn run lint > /lintresults/results.txt)
- store_artifacts:
path: /lintresults

Expand All @@ -202,13 +227,15 @@ jobs:
command: *defaults_Dependencies
- checkout
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Create dir for test results
command: mkdir -p ./audit/results
- run:
name: Check for new npm vulnerabilities
command: npm run audit:check --silent -- --json > ./audit/results/auditResults.json
command: yarn run audit:check --silent -- --json > ./audit/results/auditResults.json
- store_artifacts:
path: ./audit/results

Expand All @@ -222,7 +249,9 @@ jobs:
- run:
<<: *defaults_license_scanner
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Prune non-production packages before running license-scanner
command: npm prune --production
Expand Down Expand Up @@ -324,7 +353,9 @@ jobs:
command: *defaults_Dependencies
- checkout
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Configure git
command: |
Expand All @@ -339,7 +370,7 @@ jobs:
ssh-keyscan github.com >> ~/.ssh/known_hosts
- run:
name: Generate changelog and bump package version
command: npm run release
command: yarn run release
- run:
name: Push the release
command: git push --follow-tags origin ${CIRCLE_BRANCH}
Expand Down Expand Up @@ -413,7 +444,9 @@ jobs:
name: Install general dependencies
command: *defaults_Dependencies
- restore_cache:
key: dependency-cache-v3-{{ checksum "package-lock.json" }}
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: setup environment vars for LATEST release
command: |
Expand Down
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ junit.xml
secrets/*.pem
coverage
.env
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# https://devspace.sh/
devspace*
.devspace/**.*

*.log
*IGNORE*
**/dist/*
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn dep:check
yarn build
yarn lint
yarn test:unit
3 changes: 3 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reject": []
}
550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* [email protected]
* [email protected]
* [email protected]
69 changes: 36 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
FROM node:16.15.0-alpine as builder

RUN apk add --no-cache git python3 build-base

EXPOSE 3000

WORKDIR /src

# This is super-ugly, but it means we don't have to re-run npm install every time any of the source
# files change- only when any dependencies change- which is a superior developer experience when
# relying on docker-compose.
COPY ./package.json .
COPY ./package-lock.json .
RUN npm ci --only=production
FROM node:16.15.0-alpine

ARG BUILD_DATE
ARG VCS_URL
ARG VCS_REF
ARG VERSION

# See http://label-schema.org/rc1/ for label schema info
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="sdk-scheme-adapter"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.vcs-url=$VCS_URL
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.url="https://mojaloop.io/"
LABEL org.label-schema.version=$VERSION

COPY --from=builder /src/ /src
COPY ./src ./src
COPY ./secrets /

CMD ["node", "src/index.js"]
# RUN apk add --no-cache git python3 build-base

# EXPOSE 3000

# WORKDIR /src

# # This is super-ugly, but it means we don't have to re-run npm install every time any of the source
# # files change- only when any dependencies change- which is a superior developer experience when
# # relying on docker-compose.
# COPY ./package.json .
# COPY ./package-lock.json .
# RUN npm ci --only=production
# FROM node:16.15.0-alpine

# ARG BUILD_DATE
# ARG VCS_URL
# ARG VCS_REF
# ARG VERSION

# # See http://label-schema.org/rc1/ for label schema info
# LABEL org.label-schema.schema-version="1.0"
# LABEL org.label-schema.name="sdk-scheme-adapter"
# LABEL org.label-schema.build-date=$BUILD_DATE
# LABEL org.label-schema.vcs-url=$VCS_URL
# LABEL org.label-schema.vcs-ref=$VCS_REF
# LABEL org.label-schema.url="https://mojaloop.io/"
# LABEL org.label-schema.version=$VERSION

# COPY --from=builder /src/ /src
# COPY ./src ./src
# COPY ./secrets /

# CMD ["node", "src/index.js"]


# TODO: compose the docker image
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions modules/api-svc/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LICENSE

Copyright © 2017 Bill & Melinda Gates Foundation

The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0
(the "License") and you may not use these files except in compliance with the [License](http://www.apache.org/licenses/LICENSE-2.0). You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the [License](http://www.apache.org/licenses/LICENSE-2.0).
File renamed without changes.
Loading