This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into magpint/versionBump
- Loading branch information
Showing
6 changed files
with
179 additions
and
2 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,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 |
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,9 @@ | ||
FROM node:8 | ||
|
||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN npm install | ||
RUN npm run dist | ||
|
||
EXPOSE 3000 | ||
CMD [ "npm", "run", "serve:dist" ] |
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,8 @@ | ||
FROM node:8 | ||
|
||
WORKDIR /usr/src/app | ||
COPY . . | ||
RUN npm install | ||
|
||
EXPOSE 3000 | ||
CMD [ "npm", "start" ] |
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,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 |
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,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 | ||
|
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