This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from ncats/development
v2.2.1 production release
- Loading branch information
Showing
179 changed files
with
27,182 additions
and
16,374 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 @@ | ||
node_modules |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,24 +1,34 @@ | ||
FROM node:16.10-alpine AS build | ||
FROM node:18.16-alpine3.17 AS build | ||
|
||
ENV npm_config_unsafe_perm=true | ||
|
||
# Set the source folder | ||
ARG SOURCE_FOLDER="./" | ||
|
||
# Create app directory | ||
WORKDIR /var/www/app | ||
|
||
COPY ${SOURCE_FOLDER} . | ||
|
||
# Bundle app source | ||
RUN apk update && apk upgrade && \ | ||
apk add --no-cache bash git openssh && \ | ||
npm config set unsafe-perm true && \ | ||
npm i -g @angular/cli && \ | ||
npm install -g nx && \ | ||
npm i && \ | ||
NODE_OPTIONS=--max_old_space_size=4096 nx run ramp-client:prerender:production --verbose | ||
RUN apk update && apk upgrade | ||
RUN apk add --no-cache bash git openssh | ||
#RUN npm install --unsafe-perm=true | ||
#RUN npm config set unsafe-perm true | ||
RUN npm i -g @angular/cli | ||
RUN npm install -g nx | ||
RUN npm install | ||
RUN nx g @nrwl/workspace:fix-configuration | ||
RUN npm i | ||
RUN NODE_OPTIONS=--max_old_space_size=4096 nx run ramp-client:prerender:production --verbose | ||
|
||
FROM registry.ncats.nih.gov:5000/labshare/docker-base-web | ||
|
||
# Install NCATS required packages | ||
RUN apt-get update && apt-get install -y net-tools | ||
|
||
COPY --from=build /var/www/app/dist/ramp-client/browser /var/www/app | ||
|
||
# Add read permissions to all files under assets directory | ||
RUN chmod -R o+r /var/www/app/assets/* | ||
RUN echo "Checkout assets file permissions" && ls -la /var/www/app/assets/* |
This file was deleted.
Oops, something went wrong.
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,113 @@ | ||
pipeline { | ||
options { | ||
timestamps() | ||
} | ||
parameters { | ||
string(name: 'BUILD_VERSION', defaultValue: '', description: 'The build version to deploy (optional)') | ||
string(name: 'ENVIRONMENT', defaultValue: 'ci', description: 'Role Name (mandatory)') | ||
} | ||
agent { | ||
label 'ci && rampdb' | ||
} | ||
triggers { | ||
pollSCM('H/5 * * * *') | ||
} | ||
environment { | ||
PROJECT_NAME = "rampdb" | ||
DOCKER_REPO_NAME = "853771734544.dkr.ecr.us-east-1.amazonaws.com/rampdb-client" | ||
APP_TYPE = "ui" // Application Type is required to get Secret from Vault // | ||
} | ||
stages { | ||
stage ('Clean and Checkout Source Code') { | ||
steps { | ||
cleanWs() | ||
checkout scm | ||
} | ||
} | ||
stage('Build Version') { | ||
when { | ||
allOf { | ||
expression { | ||
return !params.BUILD_VERSION | ||
} | ||
anyOf { | ||
changeset "apps/ramp-client/*" | ||
triggeredBy 'UserIdCause' | ||
} | ||
} | ||
} | ||
steps{ | ||
script { | ||
BUILD_VERSION_GENERATED = VersionNumber( | ||
versionNumberString: 'v${BUILD_YEAR, XX}.${BUILD_MONTH, XX}${BUILD_DAY, XX}.${BUILDS_TODAY}', | ||
projectStartDate: '1970-01-01', | ||
skipFailedBuilds: true) | ||
currentBuild.displayName = BUILD_VERSION_GENERATED | ||
env.BUILD_VERSION = BUILD_VERSION_GENERATED | ||
env.BUILD = 'true' | ||
} | ||
} | ||
} | ||
stage('Build CI Docker Image') { | ||
when { | ||
allOf { | ||
expression { | ||
return !params.BUILD_VERSION | ||
} | ||
anyOf { | ||
changeset "apps/ramp-client/*" | ||
triggeredBy 'UserIdCause' | ||
} | ||
} | ||
} | ||
steps { | ||
configFileProvider([ | ||
configFile(fileId: 'rampdb-client-environment-ci.ts', targetLocation: 'rampdb-client-environment-ci.ts') | ||
]){ | ||
script { | ||
withEnv([ | ||
"BUILD_VERSION=" + (params.BUILD_VERSION ?: env.BUILD_VERSION) | ||
]) { | ||
sh '''#!/bin/bash | ||
cp rampdb-client-environment-ci.ts apps/ramp-client/src/environments/environment.prod.ts | ||
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 853771734544.dkr.ecr.us-east-1.amazonaws.com | ||
sed -i -e "s/registry.ncats.nih.gov:5000/853771734544.dkr.ecr.us-east-1.amazonaws.com/" apps/ramp-client/Dockerfile | ||
docker build -f apps/ramp-client/Dockerfile --no-cache --build-arg BUILD_VERSION=${BUILD_VERSION} -t ${DOCKER_REPO_NAME} . | ||
docker tag ${DOCKER_REPO_NAME}:latest ${DOCKER_REPO_NAME}:${BUILD_VERSION} | ||
docker push ${DOCKER_REPO_NAME}:${BUILD_VERSION} | ||
''' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('Deploy Application') { | ||
when { | ||
anyOf { | ||
changeset "apps/ramp-client/*" | ||
triggeredBy 'UserIdCause' | ||
} | ||
} | ||
steps { | ||
configFileProvider([ | ||
configFile(fileId: 'docker-compose-ui.yaml', targetLocation: 'docker-compose.yaml') | ||
]) { | ||
sh """ | ||
docker-compose -p $PROJECT_NAME-$APP_TYPE down -v --rmi all | xargs echo | ||
docker pull $DOCKER_REPO_NAME:$BUILD_VERSION | ||
docker rmi $DOCKER_REPO_NAME:current | xargs echo | ||
docker tag $DOCKER_REPO_NAME:$BUILD_VERSION $DOCKER_REPO_NAME:current | ||
docker-compose -p $PROJECT_NAME-$APP_TYPE up -d | ||
docker rmi \$(docker images -aq) | xargs echo | ||
""" | ||
} | ||
} | ||
post { | ||
always { | ||
echo " Clean up the workspace in deploy node!" | ||
cleanWs() | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.