Skip to content

Commit 346f797

Browse files
Clinton WerthClinton Werth
authored andcommitted
initial actions for build test and release. dockerfile fix
1 parent 67c8572 commit 346f797

File tree

8 files changed

+14167
-2560
lines changed

8 files changed

+14167
-2560
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: test and package sftp service plugin
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
paths:
8+
- .github/workflows/build_test.sftp.service.yaml
9+
- .github/workflows/config.yaml
10+
- plugins/sftp/service/**
11+
12+
jobs:
13+
14+
config:
15+
uses: ./.github/workflows/config.yaml
16+
17+
test:
18+
name: test plugin sftp.service
19+
needs: [ config ]
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
node: ${{ fromJSON(needs.config.outputs.node_versions-all-json) }}
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v4
27+
- name: setup node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node }}
31+
cache: npm
32+
cache-dependency-path: |
33+
plugins/sftp/service/package-lock.json
34+
- name: test with node ${{ matrix.node }}
35+
run: |
36+
cd plugins/sftp/service
37+
npm ci
38+
npm test
39+
40+
package:
41+
name: package plugin sftp.service
42+
needs: [ config, test ]
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: checkout
46+
uses: actions/checkout@v4
47+
- name: setup node
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: ${{ needs.config.outputs.node_versions-lts }}
51+
cache: npm
52+
cache-dependency-path: |
53+
plugins/sftp/service/package-lock.json
54+
- name: build
55+
run: |
56+
cd plugins/sftp/service
57+
npm ci
58+
npm run build
59+
- name: pack
60+
run: npm pack ./plugins/sftp/service
61+
- name: upload package
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: sftp.service-artifacts
65+
path: |
66+
ngageoint-mage.*.tgz
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: test and package sftp web plugin
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
push:
7+
paths:
8+
- .github/workflows/build_test.sftp.web.yaml
9+
- .github/workflows/config.yaml
10+
- plugins/sftp/web/**
11+
12+
jobs:
13+
14+
config:
15+
uses: ./.github/workflows/config.yaml
16+
17+
build:
18+
name: build plugin mage.sftp.web
19+
needs: config
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v4
24+
- name: setup node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ needs.config.outputs.node_versions-lts }}
28+
cache: npm
29+
cache-dependency-path: plugins/sftp/web/package-lock.json
30+
- name: build
31+
run: |
32+
cd plugins/sftp/web
33+
npm ci
34+
npm run build
35+
env:
36+
NODE_OPTIONS: "--max_old_space_size=4096"
37+
- name: test
38+
run: |
39+
cd plugins/sftp/web
40+
npm run test-headless
41+
- name: pack
42+
run: |
43+
npm pack ./plugins/sftp/web/dist/main
44+
- name: upload packages
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: sftp.web-artifacts
48+
path: |
49+
ngageoint-mage.sftp.web-*.tgz
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: release sftp plugin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: The version you want to assign to the release
8+
type: string
9+
required: true
10+
11+
# TODO: possibly use release branches to perform the release process
12+
# push:
13+
# branches:
14+
# - release/*
15+
# - prerelease/*
16+
# TODO: possibly use release event to perform the release process
17+
# release:
18+
19+
jobs:
20+
21+
config:
22+
uses: ./.github/workflows/config.yaml
23+
24+
check_release_version:
25+
needs: [ config ]
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: checkout
29+
uses: actions/checkout@v4
30+
- name: setup node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ needs.config.outputs.node_versions-lts }}
34+
- name: install json util
35+
run: npm i -g json
36+
- name: check service
37+
run: |
38+
[[ $(json version < ./plugins/sftp/service/package.json) = ${{ inputs.version }} ]] || exit 1
39+
- name: check web
40+
run: |
41+
[[ $(json version < ./plugins/sftp/web/package.json) = ${{ inputs.version }} ]] || exit 1
42+
build_and_test-service:
43+
needs: [ check_release_version ]
44+
uses: ./.github/workflows/build_test.sftp.service.yaml
45+
46+
build_and_test-web:
47+
needs: [ check_release_version ]
48+
uses: ./.github/workflows/build_test.sftp.web.yaml
49+
50+
publish_packages:
51+
name: publish packages
52+
needs: [ config, build_and_test-service ]
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: setup node
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: ${{ needs.config.outputs.node_versions-lts }}
59+
- name: install json util
60+
run: npm i -g json
61+
- name: download service packages
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: sftp.service-artifacts
65+
- name: download web packages
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: sftp.web-artifacts
69+
- name: publish to package registry
70+
run: |
71+
npm config set -- '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
72+
npm publish --access public $(ls -1 ngageoint-mage.sftp.service-*.tgz)
73+
npm publish --access public $(ls -1 ngageoint-mage.sftp.web-*.tgz)

Dockerfile

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Build service
21
FROM node:20.11.1 AS build-service
32

43
WORKDIR /service
@@ -25,7 +24,7 @@ FROM node:20.11.1 AS build-arcwebplugin
2524
WORKDIR /arcgiswebplugin
2625
COPY plugins/arcgis/web-app/package*.json ./
2726
RUN npm install
28-
COPY --from=build-service /service /arcgisserviceplugin/node_modules/@ngageoint/mage.service
27+
COPY --from=build-service /service /arcgiswebplugin/node_modules/@ngageoint/mage.service
2928
COPY plugins/arcgis/web-app/ ./
3029
RUN npm run build
3130
RUN npm pack ./dist/main
@@ -39,36 +38,63 @@ COPY plugins/arcgis/service/ ./
3938
RUN npm run build
4039
RUN npm pack
4140

42-
FROM node:20.11.1 AS build-imageserviceplugin
43-
WORKDIR /imageserviceplugin
44-
COPY plugins/image/service/package*.json ./
41+
# FROM node:20.11.1 AS build-imageserviceplugin
42+
# WORKDIR /imageserviceplugin
43+
# COPY plugins/image/service/package*.json ./
44+
# RUN npm install
45+
# COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service
46+
# RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose
47+
# COPY plugins/image/service/ ./
48+
# RUN npm run build
49+
# RUN npm pack
50+
51+
FROM node:20.11.1 AS build-sftpserviceplugin
52+
WORKDIR /sftpserviceplugin
53+
COPY plugins/sftp/service/package*.json ./
54+
RUN ls -la /sftpserviceplugin
55+
RUN cat package.json
56+
RUN npm cache clean --force
4557
RUN npm install
46-
COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service
47-
RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose
48-
COPY plugins/image/service/ ./
58+
COPY --from=build-service /service /sftpserviceplugin/node_modules/@ngageoint/mage.service
59+
COPY plugins/sftp/service/ ./
4960
RUN npm run build
5061
RUN npm pack
5162

63+
FROM node:20.11.1 AS build-sftpwebplugin
64+
# Build sftp service plugin
65+
WORKDIR /sftpwebplugin
66+
COPY plugins/sftp/web/package*.json ./
67+
RUN npm install
68+
COPY plugins/sftp/web/ ./
69+
RUN npm run build
70+
RUN npm pack ./dist/admin
71+
5272
# Build instance
5373
FROM node:20.11.1 AS build-instance
5474
COPY --from=build-service /service/ngageoint*.tgz /service/
5575
COPY --from=build-webapp /web-app/ngageoint*.tgz /web-app/
5676
COPY --from=build-arcwebplugin /arcgiswebplugin/ngageoint*.tgz /arcgiswebplugin/
5777
COPY --from=build-arcserviceplugin /arcgisserviceplugin/ngageoint*.tgz /arcgisserviceplugin/
58-
COPY --from=build-imageserviceplugin /imageserviceplugin/ngageoint*.tgz /imageserviceplugin/
78+
COPY --from=build-sftpwebplugin /sftpwebplugin/ngageoint*.tgz /sftpwebplugin/
79+
COPY --from=build-sftpserviceplugin /sftpserviceplugin/ngageoint*.tgz /sftpserviceplugin/
80+
# COPY --from=build-imageserviceplugin /imageserviceplugin/ngageoint*.tgz /imageserviceplugin/
5981

6082
WORKDIR /instance
61-
RUN npm install ../service/ngageoint-mage.service*.tgz \
62-
npm install ../web-app/ngageoint-mage.web-app*.tgz \
63-
npm install ../arcgiswebplugin/ngageoint*.tgz \
64-
npm install ../arcgisserviceplugin/ngageoint*.tgz \
65-
npm install ../imageserviceplugin/ngageoint*.tgz
83+
RUN ls -la ../sftpwebplugin
84+
RUN npm install ../sftpwebplugin/ngageoint*.tgz
85+
RUN npm install ../sftpserviceplugin/ngageoint*.tgz
86+
RUN npm install ../service/ngageoint-mage.service*.tgz
87+
RUN npm install ../web-app/ngageoint-mage.web-app*.tgz
88+
RUN npm install ../arcgiswebplugin/ngageoint*.tgz
89+
RUN npm install ../arcgisserviceplugin/ngageoint*.tgz
6690

6791

6892
ENV NODE_PATH=./node_modules
6993
ENTRYPOINT [ \
7094
"./node_modules/.bin/mage.service", \
7195
"--plugin", "@ngageoint/mage.image.service", \
7296
"--plugin", "@ngageoint/mage.arcgis.service", \
97+
"--plugin", "@ngageoint/mage.sftp.service", \
98+
"--web-plugin", "@ngageoint/mage.sftp.web", \
7399
"--web-plugin", "@ngageoint/mage.arcgis.web-app" \
74-
]
100+
]

0 commit comments

Comments
 (0)