This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
860a4e1
commit 9b2de5a
Showing
46 changed files
with
8,638 additions
and
0 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,50 @@ | ||
name: PFI Exemplar Container Image Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-image: | ||
name: ${{ matrix.directory }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- directory: javascript/tbdex-pfi-exemplar | ||
image: ghcr.io/tbd54566975/tbd-examples-tbdex-pfi-exemplar | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the container registry | ||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Extract metadata (tags, labels) | ||
id: meta | ||
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | ||
with: | ||
images: ${{ matrix.image }} | ||
|
||
- name: Build and push container image | ||
uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1 | ||
with: | ||
context: ${{ matrix.directory }} | ||
push: true | ||
target: ${{ matrix.target }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,27 @@ | ||
{ | ||
|
||
"setupTasks": [ | ||
{ | ||
"name": "Install Node dependencies", | ||
"command": "npm install" | ||
}, | ||
{ | ||
"name": "Install dbmate", | ||
"command": "curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64 && chmod +x /usr/local/bin/dbmate" | ||
}, | ||
{ | ||
"name": "prepare scripts", | ||
"command": "chmod +x ./db/scripts/*" | ||
} | ||
], | ||
|
||
"tasks" : { | ||
"install": { | ||
"name": "Install deps", | ||
"command": "npm install" | ||
} | ||
} | ||
|
||
|
||
|
||
} |
22 changes: 22 additions & 0 deletions
22
javascript/tbdex-pfi-exemplar/.devcontainer/devcontainer.json
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 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
{ | ||
"name": "Node.js & TypeScript", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye" | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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,5 @@ | ||
node_modules | ||
npm-debug.log | ||
docker-compose.yml | ||
.DS_Store | ||
.git |
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,12 @@ | ||
# environment info | ||
ENV= | ||
LOG_LEVEL= | ||
HOST= | ||
PORT= | ||
|
||
# DB info | ||
SEC_DB_HOST= | ||
SEC_DB_PORT= | ||
SEC_DB_USER= | ||
SEC_DB_PASSWORD= | ||
SEC_DB_NAME= |
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,41 @@ | ||
/** @type {import('eslint').ESLint.ConfigData} */ | ||
module.exports = { | ||
root: true, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion : 2022, | ||
sourceType : 'module' | ||
}, | ||
ignorePatterns: ['dist'], | ||
plugins : ['@typescript-eslint'], | ||
env : { | ||
node : true, | ||
es2022 : true | ||
}, | ||
rules: { | ||
'quotes': [ | ||
'error', | ||
'single', | ||
{ 'allowTemplateLiterals': true } | ||
], | ||
'indent' : ['error', 2, { 'SwitchCase': 1 }], | ||
'no-unused-vars' : 'off', | ||
'prefer-const' : 'off', | ||
'@typescript-eslint/no-unused-vars' : [ | ||
'error', | ||
{ | ||
'vars' : 'all', | ||
'args' : 'after-used', | ||
'ignoreRestSiblings' : true, | ||
'argsIgnorePattern' : '^_', | ||
'varsIgnorePattern' : '^_' | ||
} | ||
], | ||
'@typescript-eslint/no-explicit-any' : 'off', | ||
'@typescript-eslint/semi' : ['error', 'never'], | ||
'no-trailing-spaces' : ['error'], | ||
'@typescript-eslint/ban-ts-comment' : 'off', | ||
'space-infix-ops' : ['warn'] | ||
} | ||
} |
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,9 @@ | ||
dist | ||
node_modules/ | ||
.env | ||
.DS_STORE | ||
alice.json | ||
issuer.json | ||
pfi.json | ||
DATASTORE | ||
*.txt |
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,5 @@ | ||
{ | ||
"enable-source-maps": true, | ||
"exit": true, | ||
"spec": ["dist/test/**/*.spec.js"] | ||
} |
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 @@ | ||
registry=https://registry.npmjs.org |
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 @@ | ||
20.3.1 |
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,14 @@ | ||
{ | ||
"name": "TBDex PFI", | ||
"tests": { | ||
"pre": [ | ||
"npm install", | ||
"wget https://github.com/amacneil/dbmate/releases/download/v1.12.1/dbmate-linux-amd64 && echo 36430799fa4a4265e05593adf6b5705339c8ddc1d0bcc94040f548c0304c5cf4 dbmate-linux-amd64 | sha256sum -c", | ||
"chmod +x dbmate-linux-amd64", | ||
"sudo mv dbmate-linux-amd64 /usr/bin/dbmate", | ||
"./db/scripts/start-pg", | ||
"./db/scripts/migrate" | ||
], | ||
"commands": ["npm run test:ci"] | ||
} | ||
} |
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,19 @@ | ||
# Use the official Node.js image as the base image | ||
FROM node:lts | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /home/node/app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY --chown=node:node . /home/node/app/ | ||
|
||
# Install the application dependencies | ||
RUN npm i | ||
|
||
# Download and install dbmate | ||
RUN curl -fsSL https://github.com/amacneil/dbmate/releases/download/v1.12.1/dbmate-linux-amd64 -o dbmate \ | ||
&& chmod +x dbmate \ | ||
&& mv dbmate /usr/local/bin | ||
|
||
EXPOSE 9000 | ||
CMD [ "npm", "run", "server" ] |
Oops, something went wrong.