Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
  •  
  •  
  •  
56 changes: 56 additions & 0 deletions .github/workflows/aws_dev.deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: AWS Dev Deployment

on:
push:
branches:
- "**"
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Set IMAGE_TAG
run: |
if [[ "${{ github.ref_name }}" == "test" ]]; then
echo "IMAGE_TAG=test" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev" >> $GITHUB_ENV
fi

- name: AWS config
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_DEV_ROLE }}
role-session-name: GithubNGAGeointSession
aws-region: ${{ secrets.AWS_DEV_REGION }}

- name: AWS ECR Login
id: ecr-login
uses: aws-actions/amazon-ecr-login@v2

- name: Build Docker image
env:
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: "/mage/server"
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
docker build -t $REGISTRY$REPOSITORY:$IMAGE_TAG .

- name: Push Image and ReDeploy ECS Service
if: github.ref =='refs/heads/test' || github.ref =='refs/heads/develop'
env:
SERVICE: "mage${{ env.IMAGE_TAG }}"
REGISTRY: ${{ steps.ecr-login.outputs.registry }}
REPOSITORY: "/mage/server"
IMAGE_TAG: ${{ env.IMAGE_TAG }}
run: |
docker push $REGISTRY$REPOSITORY:$IMAGE_TAG
aws ecs update-service --cluster magedev --service $SERVICE --force-new-deployment
42 changes: 0 additions & 42 deletions .github/workflows/dev.container_build.yaml

This file was deleted.

25 changes: 15 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ on:
required: false
default: true

# TODO: possibly use release branches to perform the release process
# push:
# branches:
# - release/*
# - prerelease/*
# TODO: possibly use release event to perform the release process
# release:

jobs:
config:
uses: ./.github/workflows/config.yaml
Expand Down Expand Up @@ -102,17 +110,11 @@ jobs:
name: publish packages
needs: [config, create_release]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: setup node
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: ${{ needs.config.outputs.node_versions-lts }}
registry-url: "https://registry.npmjs.org"
- name: update npm
run: npm install -g npm@latest
- name: install json util
run: npm i -g json
- name: download service packages
Expand All @@ -125,10 +127,13 @@ jobs:
name: mage.web-app-artifacts
- name: publish mage service
run: |
npm publish --access public $(ls -1 ngageoint-mage.service-*.tgz) ${{(inputs.is_prerelease && '--tag beta') || ''}} || echo "skipping mage service publish..."
npm config set -- '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
npm publish --access public $(ls -1 ngageoint-mage.service-*.tgz) || echo "skipping mage service publish..."
- name: publish mage web
run: |
npm publish --access public $(ls -1 ngageoint-mage.web-app-*.tgz) ${{(inputs.is_prerelease && '--tag beta') || ''}} || echo "skipping mage web app publish..."
npm config set -- '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
npm publish --access public $(ls -1 ngageoint-mage.web-app-*.tgz) || echo "skipping mage web app publish..."
- name: publish mage core
run: |
npm publish --access public $(ls -1 ngageoint-mage.web-core-lib-*.tgz) ${{(inputs.is_prerelease && '--tag beta') || ''}} || echo "skipping mage core publish..."
npm config set -- '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
npm publish --access public $(ls -1 ngageoint-mage.web-core-lib-*.tgz) || echo "skipping mage core publish..."
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log

All notable changes to this project will be documented in this file.
Mage adheres to [Semantic Versioning](http://semver.org/).
MAGE adheres to [Semantic Versioning](http://semver.org/).

---

Expand Down
1 change: 0 additions & 1 deletion CODEOWNERS

This file was deleted.

122 changes: 66 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ COPY service/package*.json ./
RUN npm install
COPY service/ ./
RUN npm run build

RUN npm pack

# Build web-app
Expand All @@ -15,74 +16,83 @@ COPY web-app/package*.json ./
RUN npm install
COPY web-app/ ./
RUN npm run build

RUN npm pack ./dist

# FROM node:20.11.1 AS build-arcwebplugin
# # Build arcgis service plugin
# WORKDIR /arcgiswebplugin
# COPY plugins/arcgis/web-app/package*.json ./
# RUN npm install
# COPY --from=build-service /service /arcgiswebplugin/node_modules/@ngageoint/mage.service
# COPY plugins/arcgis/web-app/ ./
# RUN npm run build
# RUN npm pack ./dist/main
FROM node:20.11.1 AS build-arcwebplugin
# Build arcgis service plugin
WORKDIR /arcgiswebplugin
COPY plugins/arcgis/web-app/package*.json ./
RUN npm install
COPY --from=build-service /service /arcgiswebplugin/node_modules/@ngageoint/mage.service
COPY plugins/arcgis/web-app/ ./
RUN npm run build
RUN npm pack ./dist/main

# FROM node:20.11.1 AS build-arcserviceplugin
# WORKDIR /arcgisserviceplugin
# COPY plugins/arcgis/service/package*.json ./
# RUN npm install
# COPY --from=build-service /service /arcgisserviceplugin/node_modules/@ngageoint/mage.service
# COPY plugins/arcgis/service/ ./
# RUN npm run build
# RUN npm pack
FROM node:20.11.1 AS build-arcserviceplugin
WORKDIR /arcgisserviceplugin
COPY plugins/arcgis/service/package*.json ./
RUN npm install
COPY --from=build-service /service /arcgisserviceplugin/node_modules/@ngageoint/mage.service
COPY plugins/arcgis/service/ ./
RUN npm run build
RUN npm pack

# FROM node:20.11.1 AS build-imageserviceplugin
# WORKDIR /imageserviceplugin
# COPY plugins/image/service/package*.json ./
# RUN npm install
# COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service
# RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose
# COPY plugins/image/service/ ./
# RUN npm run build
# RUN npm pack
FROM node:20.11.1 AS build-imageserviceplugin
WORKDIR /imageserviceplugin
COPY plugins/image/service/package*.json ./
RUN npm install
COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service
RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose
COPY plugins/image/service/ ./
RUN npm run build
RUN npm pack

# FROM node:20.11.1 AS build-sftpserviceplugin
# WORKDIR /sftpserviceplugin
# COPY plugins/sftp/service/package*.json ./
# RUN npm install
# COPY --from=build-service /service /sftpserviceplugin/node_modules/@ngageoint/mage.service
# COPY plugins/sftp/service/ ./
# RUN npm run build
# RUN npm pack
FROM node:20.11.1 AS build-sftpserviceplugin
WORKDIR /sftpserviceplugin
COPY plugins/sftp/service/package*.json ./
RUN npm install
COPY --from=build-service /service /sftpserviceplugin/node_modules/@ngageoint/mage.service
COPY plugins/sftp/service/ ./
RUN npm run build
RUN npm pack

# FROM node:20.11.1 AS build-sftpwebplugin
# # Build sftp service plugin
# WORKDIR /sftpwebplugin
# COPY plugins/sftp/web/package*.json ./
# RUN npm install
# COPY plugins/sftp/web/ ./
# RUN npm run build
# RUN npm pack ./dist/main
FROM node:20.11.1 AS build-sftpwebplugin
# Build sftp service plugin
WORKDIR /sftpwebplugin
COPY plugins/sftp/web/package*.json ./
RUN npm install
COPY plugins/sftp/web/ ./
RUN npm run build
RUN npm pack ./dist/main

# Build instance
FROM node:20.11.1 AS build-instance
COPY --from=build-service /service/ngageoint*.tgz /service/
COPY --from=build-webapp /web-app/ngageoint*.tgz /web-app/
# COPY --from=build-arcwebplugin /arcgiswebplugin/ngageoint*.tgz /arcgiswebplugin/
# COPY --from=build-arcserviceplugin /arcgisserviceplugin/ngageoint*.tgz /arcgisserviceplugin/
# COPY --from=build-sftpserviceplugin /sftpserviceplugin/ngageoint*.tgz /sftpserviceplugin/
# COPY --from=build-sftpwebplugin /sftpwebplugin/ngageoint*.tgz /sftpwebplugin/
COPY --from=build-arcwebplugin /arcgiswebplugin/ngageoint*.tgz /arcgiswebplugin/
COPY --from=build-arcserviceplugin /arcgisserviceplugin/ngageoint*.tgz /arcgisserviceplugin/
COPY --from=build-sftpserviceplugin /sftpserviceplugin/ngageoint*.tgz /sftpserviceplugin/
COPY --from=build-sftpwebplugin /sftpwebplugin/ngageoint*.tgz /sftpwebplugin/
COPY --from=build-imageserviceplugin /imageserviceplugin/ngageoint*.tgz /imageserviceplugin/

ENV MAGE_HOME=/home/mage/instance
WORKDIR ${MAGE_HOME}
WORKDIR /instance
RUN ls -la ../sftpwebplugin
RUN npm install ../service/ngageoint-mage.service*.tgz
RUN npm install ../web-app/ngageoint-mage.web-app*.tgz
RUN npm install ../sftpwebplugin/ngageoint-mage.sftp.web*.tgz
RUN npm install ../sftpserviceplugin/ngageoint-mage.sftp.service*.tgz
RUN npm install ../arcgiswebplugin/ngageoint*.tgz
RUN npm install ../arcgisserviceplugin/ngageoint*.tgz
RUN npm install ../imageserviceplugin/ngageoint*.tgz

RUN npm install ../../../service/ngageoint-mage.service*.tgz
RUN npm install ../../../web-app/ngageoint-mage.web-app*.tgz
# RUN npm install ../../../sftpwebplugin/ngageoint-mage.sftp.web*.tgz
# RUN npm install ../../../sftpserviceplugin/ngageoint-mage.sftp.service*.tgz
# RUN npm install ../../../arcgiswebplugin/ngageoint*.tgz
# RUN npm install ../../../arcgisserviceplugin/ngageoint*.tgz
RUN ln -s ./node_modules/.bin/mage.service

ENV NODE_PATH=./node_modules
ENTRYPOINT [ "./mage.service" ]
ENTRYPOINT [ \
"./node_modules/.bin/mage.service", \
"--plugin", "@ngageoint/mage.image.service", \
"--plugin", "@ngageoint/mage.arcgis.service", \
"--plugin", "@ngageoint/mage.sftp.service", \
"--web-plugin", "@ngageoint/mage.sftp.web", \
"--web-plugin", "@ngageoint/mage.arcgis.web-app" \
]
Loading
Loading