Skip to content

Commit

Permalink
chore(mojaloop/#3386): sdk nodejs maintenance upgrade (#453)
Browse files Browse the repository at this point in the history
chore(mojaloop/#3386): sdk nodejs maintenance upgrade - mojaloop/project#3386
- Upgraded nodejs from v16 to latest v18 LTS
- Fixed CI pipeline to use NVM to select the Nodejs version from the Projects NVMRC file
- Fixed configs for NVM to install the correct Nodejs version on Alpine based CI Jobs
- Fixes to Image Scan to correctly select the correctly Nodejs Docker image for scanning
- Build-local now passes the NODE_VERSION (value from NVMRC file) as a Build-Arg to Docker Build command
- Changed Docker NODE_VERSION to LTS, and added NOTEs in Dockerfile and Documentation to main README on how to correctly set the BUILD-ARG
  • Loading branch information
mdebarros committed Jul 10, 2023
1 parent b39f630 commit 9ac931a
Show file tree
Hide file tree
Showing 10 changed files with 1,169 additions and 93 deletions.
327 changes: 243 additions & 84 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
v16.15.0
18.16.1
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.0.cjs

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions Dockerfile
@@ -1,11 +1,24 @@
# Arguments
ARG NODE_VERSION=16.15.0-alpine
ARG NODE_VERSION=lts-alpine

# NOTE: Ensure you set NODE_VERSION Build Argument as follows...
#
# export NODE_VERSION="$(cat .nvmrc)-alpine" \
# docker build \
# --build-arg NODE_VERSION=$NODE_VERSION \
# -t mojaloop/sdk-scheme-adapter:local \
# . \
#

# Build Image
FROM node:${NODE_VERSION} as builder

## Install tool dependencies
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool libressl-dev openssl-dev autoconf automake yarn
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool openssl-dev autoconf automake yarn bash

## Install & Setup LibrdKafka Lib for Builder
RUN apk add --no-cache librdkafka-dev
ENV BUILD_LIBRDKAFKA=0

WORKDIR /opt/app

Expand Down Expand Up @@ -33,7 +46,11 @@ RUN yarn install --immutable
FROM node:${NODE_VERSION}
WORKDIR /opt/app

RUN apk add --no-cache yarn
## Install general dependencies
RUN apk add --no-cache bash yarn

## Install & Setup LibrdKafka Lib for Runtime
RUN apk add --no-cache librdkafka

ARG BUILD_DATE
ARG VCS_URL=https://github.com/mojaloop/sdk-scheme-adapter
Expand Down
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -23,8 +23,34 @@ DFSP backends can call the [DFSP Outbound API](https://github.com/mojaloop/api-s

## Docker Image

### Official Packaged Release

This package is available as a pre-built docker image on Docker Hub: [https://hub.docker.com/r/mojaloop/sdk-scheme-adapter](https://hub.docker.com/r/mojaloop/sdk-scheme-adapter)


### Build from Source

You can also build it directly from source: [https://github.com/mojaloop/sdk-scheme-adapter](https://github.com/mojaloop/sdk-scheme-adapter)

However, take note of the default argument in the [Dockerfile](./Dockerfile) for `NODE_VERSION`:

```dockerfile
ARG NODE_VERSION=lts-alpine
```

It is recommend that you set the `NODE_VERSION` argument against the version set in the local [.nvmrc](./.nvmrc).

This can be done using the following command:

```bash
export NODE_VERSION="$(cat .nvmrc)-alpine"

docker build \
--build-arg NODE_VERSION=$NODE_VERSION \
-t mojaloop/sdk-scheme-adapter:local \
.
```

## NPM Package

Users who do not wish to use all the functionality of the scheme adapter as-is are able to import this package as a dependency into their own projects. The scheme adapter package is [published on npm](https://www.npmjs.com/package/@mojaloop/sdk-scheme-adapter) and exposes the following components for external use:
Expand Down
2 changes: 1 addition & 1 deletion modules/api-svc/package.json
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-api-svc",
"version": "20.7.0-snapshot.0",
"version": "20.7.0-snapshot.1",
"description": "An adapter for connecting to Mojaloop API enabled switches.",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/outbound-command-event-handler/package.json
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-outbound-command-event-handler",
"version": "0.2.20-snapshot.0",
"version": "0.2.20-snapshot.1",
"description": "mojaloop sdk scheme adapter command event handler",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
Expand Down
2 changes: 1 addition & 1 deletion modules/outbound-domain-event-handler/package.json
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-outbound-domain-event-handler",
"version": "0.2.20-snapshot.0",
"version": "0.2.20-snapshot.1",
"description": "mojaloop sdk scheme adapter outbound domain event handler",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter/",
Expand Down
2 changes: 1 addition & 1 deletion modules/private-shared-lib/package.json
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter-private-shared-lib",
"version": "0.3.20-snapshot.0",
"version": "0.3.20-snapshot.1",
"description": "SDK Scheme Adapter private shared library.",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/accounts-and-balances-bc/tree/main/modules/private-types",
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/sdk-scheme-adapter",
"version": "23.1.0",
"version": "23.1.0-snapshot.1",
"description": "mojaloop sdk-scheme-adapter",
"license": "Apache-2.0",
"homepage": "https://github.com/mojaloop/sdk-scheme-adapter",
Expand Down

0 comments on commit 9ac931a

Please sign in to comment.