soajs.multitenant 2.1.17 → 2.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +43 -0
- package/.github/workflows/release.yml +94 -0
- package/package.json +5 -5
- package/.travis.yml +0 -72
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, develop, feature/*, features/* ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
services:
|
|
14
|
+
mongodb:
|
|
15
|
+
image: mongo:8
|
|
16
|
+
ports:
|
|
17
|
+
- 27017:27017
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: '24'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm install
|
|
30
|
+
|
|
31
|
+
- name: Install grunt-cli
|
|
32
|
+
run: npm install -g grunt-cli
|
|
33
|
+
|
|
34
|
+
- name: Run linting
|
|
35
|
+
run: grunt
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
if: github.ref != 'refs/heads/master'
|
|
39
|
+
run: grunt test
|
|
40
|
+
|
|
41
|
+
- name: Run coverage
|
|
42
|
+
if: github.ref == 'refs/heads/master'
|
|
43
|
+
run: grunt coverage
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- release
|
|
7
|
+
- 'release/**'
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
services:
|
|
14
|
+
mongodb:
|
|
15
|
+
image: mongo:8
|
|
16
|
+
ports:
|
|
17
|
+
- 27017:27017
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: '24'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm install
|
|
30
|
+
|
|
31
|
+
- name: Install grunt-cli
|
|
32
|
+
run: npm install -g grunt-cli
|
|
33
|
+
|
|
34
|
+
- name: Run linting
|
|
35
|
+
run: grunt
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: grunt test
|
|
39
|
+
|
|
40
|
+
publish-docker:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
needs: test
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout code
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Extract version from package.json
|
|
49
|
+
id: version
|
|
50
|
+
run: |
|
|
51
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
52
|
+
MAJOR_VERSION=$(echo ${PACKAGE_VERSION} | awk -F. '{ print $1 }')
|
|
53
|
+
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
|
|
54
|
+
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
|
|
55
|
+
echo "Package version: ${PACKAGE_VERSION}"
|
|
56
|
+
echo "Major version: ${MAJOR_VERSION}"
|
|
57
|
+
|
|
58
|
+
- name: Set up Docker Buildx
|
|
59
|
+
uses: docker/setup-buildx-action@v3
|
|
60
|
+
|
|
61
|
+
- name: Login to Docker Hub
|
|
62
|
+
uses: docker/login-action@v3
|
|
63
|
+
with:
|
|
64
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
65
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
66
|
+
|
|
67
|
+
- name: Build and push Docker image
|
|
68
|
+
uses: docker/build-push-action@v5
|
|
69
|
+
with:
|
|
70
|
+
context: .
|
|
71
|
+
platforms: linux/amd64
|
|
72
|
+
push: true
|
|
73
|
+
tags: |
|
|
74
|
+
soajsorg/multitenant:latest
|
|
75
|
+
soajsorg/multitenant:${{ steps.version.outputs.PACKAGE_VERSION }}
|
|
76
|
+
soajsorg/multitenant:${{ steps.version.outputs.MAJOR_VERSION }}.x
|
|
77
|
+
|
|
78
|
+
- name: Create Git tag
|
|
79
|
+
run: |
|
|
80
|
+
git config --local user.name "github-actions[bot]"
|
|
81
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
82
|
+
git tag ${{ steps.version.outputs.PACKAGE_VERSION }} || true
|
|
83
|
+
|
|
84
|
+
- name: Push tag
|
|
85
|
+
run: git push origin ${{ steps.version.outputs.PACKAGE_VERSION }} || true
|
|
86
|
+
|
|
87
|
+
- name: Create GitHub Release
|
|
88
|
+
uses: softprops/action-gh-release@v1
|
|
89
|
+
with:
|
|
90
|
+
tag_name: ${{ steps.version.outputs.PACKAGE_VERSION }}
|
|
91
|
+
name: Release ${{ steps.version.outputs.PACKAGE_VERSION }}
|
|
92
|
+
generate_release_notes: true
|
|
93
|
+
env:
|
|
94
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soajs.multitenant",
|
|
3
3
|
"description": "soajs multitenant service",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.18",
|
|
5
5
|
"author": "soajs team <team@soajs.org>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"grunt-jsdoc": "2.4.1",
|
|
30
30
|
"grunt-mocha-test": "0.13.3",
|
|
31
31
|
"mocha": "11.7.5",
|
|
32
|
-
"nock": "14.0.
|
|
33
|
-
"soajs.controller": "4.
|
|
32
|
+
"nock": "14.0.11",
|
|
33
|
+
"soajs.controller": "4.3.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"async": "3.2.6",
|
|
37
|
-
"soajs": "4.1.
|
|
38
|
-
"soajs.core.libs": "1.2.
|
|
37
|
+
"soajs": "4.1.21",
|
|
38
|
+
"soajs.core.libs": "1.2.2",
|
|
39
39
|
"request": "2.88.2",
|
|
40
40
|
"uuid": "13.0.0"
|
|
41
41
|
}
|
package/.travis.yml
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
dist: focal
|
|
2
|
-
language: node_js
|
|
3
|
-
node_js: 20
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
include:
|
|
7
|
-
|
|
8
|
-
- stage: install, check code style and coverage
|
|
9
|
-
if: tag IS blank
|
|
10
|
-
services:
|
|
11
|
-
- mongodb
|
|
12
|
-
addons:
|
|
13
|
-
hosts:
|
|
14
|
-
- localhost
|
|
15
|
-
before_script:
|
|
16
|
-
- npm install -g grunt-cli
|
|
17
|
-
- sleep 10
|
|
18
|
-
script:
|
|
19
|
-
- grunt
|
|
20
|
-
- if [ "$TRAVIS_BRANCH" != "master" ]; then grunt test; fi
|
|
21
|
-
- if [ "$TRAVIS_BRANCH" = "master" ]; then grunt coverage; fi
|
|
22
|
-
|
|
23
|
-
# - stage: Publish to npm
|
|
24
|
-
# if: branch =~ /(release)/
|
|
25
|
-
# script:
|
|
26
|
-
# - echo "PUBLISH npm"
|
|
27
|
-
# deploy:
|
|
28
|
-
# skip_cleanup: true
|
|
29
|
-
# provider: npm
|
|
30
|
-
# email: $NPM_EMAIL
|
|
31
|
-
# api_key: $NPM_TOKEN
|
|
32
|
-
# on:
|
|
33
|
-
# all_branches: true
|
|
34
|
-
# condition: $TRAVIS_BRANCH =~ ^(release)*
|
|
35
|
-
|
|
36
|
-
- stage: Publish to docker registry
|
|
37
|
-
if: branch =~ /(release)/
|
|
38
|
-
script:
|
|
39
|
-
- echo "PUBLISH docker"
|
|
40
|
-
- export PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -Fn '{ print $2 }' | sed 's/[n:",]//g' | tr -d '[[:space:]]')
|
|
41
|
-
- export MAJOR_VERSION=$(echo ${PACKAGE_VERSION} | awk -F. '{ print $1 }')
|
|
42
|
-
- echo Package version ${PACKAGE_VERSION}
|
|
43
|
-
- echo Major version ${MAJOR_VERSION}
|
|
44
|
-
|
|
45
|
-
- git config --local user.name ${GIT_USER}
|
|
46
|
-
- git config --local user.email ${GIT_EMAIL}
|
|
47
|
-
- git tag ${PACKAGE_VERSION}
|
|
48
|
-
|
|
49
|
-
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
50
|
-
|
|
51
|
-
- docker build -t soajsorg/multitenant .
|
|
52
|
-
|
|
53
|
-
- docker images
|
|
54
|
-
|
|
55
|
-
- docker tag soajsorg/multitenant:latest soajsorg/multitenant:${PACKAGE_VERSION}
|
|
56
|
-
- docker tag soajsorg/multitenant:latest soajsorg/multitenant:${MAJOR_VERSION}.x
|
|
57
|
-
|
|
58
|
-
- docker push soajsorg/multitenant
|
|
59
|
-
- docker push soajsorg/multitenant:${PACKAGE_VERSION}
|
|
60
|
-
- docker push soajsorg/multitenant:${MAJOR_VERSION}.x
|
|
61
|
-
before_deploy:
|
|
62
|
-
- yes | gem update --system --force
|
|
63
|
-
- gem install bundler
|
|
64
|
-
- gem install faraday-net_http -v '3.3.0'
|
|
65
|
-
- gem install uri
|
|
66
|
-
- gem install logger
|
|
67
|
-
deploy:
|
|
68
|
-
on:
|
|
69
|
-
all_branches: true
|
|
70
|
-
provider: releases
|
|
71
|
-
api_key: ${GIT_TOKEN}
|
|
72
|
-
skip_cleanup: true
|