Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into magpint/versionBump
Browse files Browse the repository at this point in the history
  • Loading branch information
maggiepint committed Mar 1, 2018
2 parents 6b1a0ff + c9da911 commit 7fba9f2
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 2 deletions.
110 changes: 110 additions & 0 deletions deployment/CreateConstants.sh
@@ -0,0 +1,110 @@
#!/bin/bash

# Bash script to create cfg/$environment.const.js file for VSTS build

ProjectRoot=
Environment=
AadInstance=
AadTenant=
ClientId=
BaseUrl=
AuthRedirectUri=
AuthVersion=
TicketUriPrefix=
TicketUriSuffix=

Usage () {
usage="Usage: $0"
usage+=" --projectRoot projectRootPath"
usage+=" --environment localhost|dist"
usage+=" --aadInstance yourAadInstance"
usage+=" --aadTenant yourAadTenant"
usage+=" --clientId youClientId"
usage+=" --baseUrl baseUrl"
usage+=" --authRedirectUri authRedirectUri"
usage+=" --authVersion authVersion"
usage+=" --ticketUriPrefix ticketUriPrefix"
usage+=" --ticketUriSuffix ticketUriSuffix"
echo $usage
}

ThisScript="$0"

if [ $# -ne 20 ]
then
Usage $ThisScript
exit 1
fi

while [ $# -gt 0 ]
do
option="$1"

case $option in
--projectRoot)
ProjectRoot="$2"
;;
--environment)
Environment="$2"
;;
--aadInstance)
AadInstance="$2"
;;
--aadTenant)
AadTenant="$2"
;;
--clientId)
ClientId="$2"
;;
--baseUrl)
BaseUrl="$2"
;;
--authRedirectUri)
AuthRedirectUri="$2"
;;
--authVersion)
AuthVersion="$2"
;;
--ticketUriPrefix)
TicketUriPrefix="$2"
;;
--ticketUriSuffix)
TicketUriSuffix="$2"
;;
-*)
echo
echo "bad option: $option"
echo
Usage $ThisScript
exit 2
esac
shift
shift
done

content="
let baseConstants = require('./defaultConstants')
module.exports = Object.assign({}, baseConstants, {
appEnv: '$Environment',
aadInstance: '$AadInstance',
aadTenant: '$AadTenant',
clientId: '$ClientId',
baseUrl: '$BaseUrl',
authRedirectUri: '$AuthRedirectUri',
authVersion: '$AuthVersion',
ticketSystems: {
1: {
id: 1,
name: 'Default Ticket System',
ticketUriPrefix: '$TicketUriPrefix',
ticketUriSuffix: '$TicketUriSuffix'
}
}
})
"

echo
echo "$content"

outputFile="$ProjectRoot/cfg/$Environment.const.js"
echo "$content" > $outputFile
9 changes: 9 additions & 0 deletions deployment/Dockerfile.dist
@@ -0,0 +1,9 @@
FROM node:8

WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN npm run dist

EXPOSE 3000
CMD [ "npm", "run", "serve:dist" ]
8 changes: 8 additions & 0 deletions deployment/Dockerfile.localhost
@@ -0,0 +1,8 @@
FROM node:8

WORKDIR /usr/src/app
COPY . .
RUN npm install

EXPOSE 3000
CMD [ "npm", "start" ]
12 changes: 12 additions & 0 deletions deployment/UpdateImageTag.sh
@@ -0,0 +1,12 @@
#!/bin/bash

if [ $# -ne 2 ]
then
echo "Usage: ${0} yaml_file_name build_number"
exit 1
fi

echo "update file ${1}, build number ${2}"
yaml_file=$1
build_number=$2
sed -i s/sia-eventui-dist:latest/sia-eventui-dist:$build_number/ $yaml_file
38 changes: 38 additions & 0 deletions deployment/sia-eventui-ppe.yaml
@@ -0,0 +1,38 @@
apiVersion: v1
kind: Service
metadata:
name: sia-eventui-ppe-service
labels:
run: sia-eventui-ppe
spec:
type: LoadBalancer
ports:
- port: 3000
name: http
selector:
run: sia-eventui-ppe

---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sia-eventui-ppe
spec:
selector:
matchLabels:
run: sia-eventui-ppe
replicas: 1
template:
metadata:
labels:
run: sia-eventui-ppe
spec:
containers:
- name: sia-eventui-ppe
image: siacontainerregistry.azurecr.io/azure/sia-eventui-dist:latest
env:
- name: NODE_ENV
value: dist
ports:
- containerPort: 3000

4 changes: 2 additions & 2 deletions src/components/MainComponent.js
Expand Up @@ -2,15 +2,15 @@ import React from 'react'
import { Provider } from 'react-redux'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
import getMuiTheme from 'material-ui/styles/getMuiTheme'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import { Router, Route } from 'react-router-dom'
import createBrowserHistory from 'history/createBrowserHistory'
import { PersistGate } from 'redux-persist/lib/integration/react'

import CreateIncident from 'components/Search/CreateIncident'
import Ticket from 'components/Incident/Ticket'
import CompareTickets from 'components/Incident/CompareTickets'
import EnsureLoggedInContainer from 'components/Auth/EnsureLoggedIn'
import incidentRedirect from 'components/Incident/incidentRedirect'
import incidentRedirect from 'components/Incident/IncidentRedirect'
import Home from 'components/Home'
import TopNav from 'components/TopNav/TopNav'
import Debug from 'components/Debug'
Expand Down

0 comments on commit 7fba9f2

Please sign in to comment.