File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,20 @@ podTemplate(label: 'build-pod-sourcerer-app',
1212 ]
1313) {
1414 node(' build-pod-sourcerer-app' ) {
15+ def namespace = ' staging'
16+ def env = ' development'
17+ if (env. BRANCH_NAME == ' master' ) {
18+ env = ' production'
19+ namespace = ' production'
20+ }
21+
1522 stage(' checkout' ) {
1623 checkout scm
1724 }
1825
1926 stage(' build jar and test' ) {
2027 container(' gradle' ) {
21- sh(" ./do.sh build_jar_inside" )
28+ sh(" ENV= ${ env } ./do.sh build_jar_inside" )
2229 }
2330 }
2431
@@ -33,10 +40,6 @@ podTemplate(label: 'build-pod-sourcerer-app',
3340 }
3441
3542 stage(' deploy' ) {
36- def namespace = ' staging'
37- if (env. BRANCH_NAME == ' master' ) {
38- namespace = ' production'
39- }
4043 println " Deploying to ${ namespace} kubernetes namespace"
4144 sh(" NAMESPACE=${ namespace} ./do.sh deploy" )
4245 }
Original file line number Diff line number Diff line change 1+ geo $dollar {
2+ default "$";
3+ }
4+
15server {
26 listen 80 default_server;
37 server_name _;
48
9+ location /install {
10+ alias /files/install;
11+
12+ sub_filter "${dollar}SERVER_EXT" 'https://$host';
13+ sub_filter_types *;
14+ }
15+
516 location / {
617 root /files/;
718 }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ ARGUMENTS=${@}
2323
2424TAG=" ${CONTAINER_TAG:- latest} "
2525NAMESPACE=" ${NAMESPACE:- staging} "
26+ ENV=" ${ENV:- development} "
2627VOLUME=" ${BUILD_VOLUME:- $PWD } "
2728PROJECT=sourcerer-app
2829PORT=3182
@@ -35,11 +36,12 @@ GRADLE_VERSION=4.2.0
3536
3637# run only inside build container
3738build_jar_inside () {
38- gradle build
39+ gradle build -Penv $ENV
3940}
4041
4142build_jar () {
42- docker run -i -v $VOLUME :/home/gradle/app --workdir=/home/gradle/app gradle:$GRADLE_VERSION \
43+ docker run -i -v $VOLUME :/home/gradle/app --workdir=/home/gradle/app -e ENV=$ENV \
44+ gradle:$GRADLE_VERSION \
4345 ./do.sh build_jar_inside
4446}
4547
Original file line number Diff line number Diff line change 33
44echo "Installing sourcerer app.."
55
6- SERVER=https://sourcerer.io
6+ SERVER=$SERVER_EXT
77DOWNLOAD_URL=$SERVER/app/download
88JAR_DIR=/usr/local/lib
99SCRIPT_DIR=/usr/local/bin
You can’t perform that action at this time.
0 commit comments