Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #106 from ncats/development
Browse files Browse the repository at this point in the history
v2.2.1 production release
  • Loading branch information
tsheils authored Jun 16, 2023
2 parents 0eeeab3 + e5d971e commit e0d564e
Show file tree
Hide file tree
Showing 179 changed files with 27,182 additions and 16,374 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
40 changes: 0 additions & 40 deletions angular.json

This file was deleted.

17 changes: 0 additions & 17 deletions apps/ramp-client/.browserslistrc

This file was deleted.

26 changes: 18 additions & 8 deletions apps/ramp-client/Dockerfile
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/*
126 changes: 0 additions & 126 deletions apps/ramp-client/Jenkinsfile

This file was deleted.

113 changes: 113 additions & 0 deletions apps/ramp-client/Jenkinsfile-ifx
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()
}
}
}
}
}
Loading

0 comments on commit e0d564e

Please sign in to comment.