-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prod v2 #566
base: master
Are you sure you want to change the base?
Prod v2 #566
Changes from 250 commits
4f14e37
ae81ebe
46f0332
27ee903
16ab197
5ea03e9
d91d4c2
3ddf15e
2180c8f
56b59c8
22094ec
2fc5425
22386ef
b5e4cb0
d8bf01a
6269f95
53d5fdc
2bf7554
9f58da8
5b515ea
bb52962
64ae086
4fe9b16
b1b26c2
8b305b6
7c0b366
d5421df
463269e
2b029f0
e7c0ee1
ee9d626
4b30e24
d670893
945ed00
5e8ca70
4801eb4
d8bea72
a43b56f
4faa1aa
3363272
92ba47e
c176f73
9ce6306
0bd18b9
38791c6
3a314d4
deb8887
1b5069b
7aa0c60
d32b4f9
73590c6
97c9224
9a9fc1a
4f455dd
8eeb56a
961c769
4a33489
3897313
3f22c8e
5a90d44
f33735c
99dda97
527485f
bd93aa0
8b90125
2ea0391
8745fe0
f6aae3d
c9a8e11
089eb74
821782a
a8d0951
cce3f35
b4df519
6c2a315
45de2b6
8d12442
6f97429
df9de01
5840cb0
95cc30f
a39bb4e
ec18ce8
c5ecbed
d0383d0
ebc8062
355b471
3047263
44f956a
4b08157
74d5d0d
c122e05
a61e82a
0dcdf36
be5172e
a9a1559
f155755
072d9e5
05e7ced
4951429
49c6b71
7e53c2d
13b658b
3b9cdea
918e96d
3a1d540
c0daea3
1cf0ccf
b1d1a89
8163f7f
a94c0fe
3adeccc
3566d80
072c210
45eda42
a056012
ac82c8b
f0f2abc
098d1ff
bf4549e
8244880
a82a208
343e1b7
bb65f28
bfb5504
f57330c
8d86135
1b40d1a
5ebf92b
21d8503
a20ab47
3707eab
93cf016
80c88a9
d1646f8
11f5945
3a4df9c
07c35d7
46b8ff3
4e3b4b0
b6ca8be
4e40d2f
aa76542
69ed8ac
f7ea140
6e3464a
64e24b1
ab8bf7f
2cde4b7
57c9273
ce2b719
30daf57
e9d99d1
791f4c1
d9da4de
aba240a
73654eb
5770678
c67f34b
62297db
5b81766
88049c0
3418356
b63d610
d7b25fb
32af353
006d86a
1903be2
695fc35
7ba5d84
0a6a764
a031897
0158611
1334fa7
533508c
89c1d19
eafc973
7e656b4
5138eba
f29ab5e
782f711
1239087
de11adb
c67a6c1
ca189c1
a78d149
51360ed
855f65a
c098d8e
e274bfd
16c406d
217a4e4
deaecc9
7816391
a741ce9
8c5cc11
7591311
729fb4e
fa94170
37a80b1
574652a
516e99e
7268540
36bb0da
87f5d94
2fffd64
5952495
0af31ab
2b01341
37887df
997f49b
8c2f837
110aaa9
5f00144
29a5766
7fefb38
3acd1e6
918335a
257ddd1
e627693
b3a0a89
cb50699
da14438
37879d2
6b61e5b
8ca0317
9b317b5
ddad2f4
4cfe49d
1dc09f2
37b207c
84c4c6c
8836c23
1931ddb
6c0dc9e
740afea
6285ee2
42c5771
eff2b7d
655605c
4026cc1
0228a5e
55343f0
31339b2
cb66a47
3554231
c57635f
9987492
b1036be
5f3f20f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,3 @@ | ||
def app = ""; | ||
def commit_id=""; | ||
def module_name = "${env.JOB_NAME}".split("/")[-2]; | ||
def service_name = "${env.JOB_BASE_NAME}"; | ||
def path = "${module_name}/${service_name}" | ||
def build_wkflo; | ||
def ci_image = "egovio/ci:0.0.4" | ||
def notifier = ""; | ||
library 'ci-libs' | ||
|
||
try { | ||
node("slave"){ | ||
checkout scm | ||
sh "git rev-parse --short HEAD > .git/commit-id".trim() | ||
commit_id = readFile('.git/commit-id') | ||
|
||
def docker_file_exists = fileExists("${path}/Dockerfile") | ||
|
||
code_builder = load("jenkins/code_builder.groovy") | ||
notifier = load("jenkins/notifier.groovy") | ||
currentBuild.displayName = "${BUILD_ID}-${commit_id}" | ||
|
||
if (!docker_file_exists) { | ||
code_builder.build(path, ci_image) | ||
} | ||
else { | ||
archiver = load("jenkins/archiver.groovy") | ||
image_builder = load("jenkins/image_builder.groovy") | ||
code_builder.build(path, ci_image) | ||
archiver.archiveArtifacts(["${path}/target/*.jar", "${path}/target/*.html"]) | ||
image_builder.build(module_name, service_name, commit_id) | ||
image_builder.publish(service_name, commit_id) | ||
image_builder.clean(service_name, commit_id) | ||
} | ||
} | ||
} catch (e) { | ||
node{ | ||
echo | ||
notifier.notifyBuild("FAILED") | ||
throw e | ||
} | ||
} | ||
buildPipeline(configFile: './build/build-config.yml') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# config: | ||
# - name: < Name of the job, foo/bar would create job named bar inside folder foo > | ||
# build: | ||
# - work-dir: < Working directory of the app to be built > | ||
# dockerfile: < Path to the dockerfile, optional, assumes dockerfile in working directory if not provided > | ||
# image-name: < Docker image name > | ||
# - | ||
# - | ||
config: | ||
- name: "builds/punjab-rainmaker-customization/rainmaker-custom-service" | ||
build: | ||
- work-dir: "rainmaker-custom-service" | ||
image-name: "rainmaker-custom-service" | ||
dockerfile: "rainmaker-custom-service/Dockerfile" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||||||||||||||
FROM node:8.12-alpine | ||||||||||||||||||
RUN npm install -g yarn | ||||||||||||||||||
RUN mkdir /opt/app | ||||||||||||||||||
COPY package.json yarn.lock /opt/app/ | ||||||||||||||||||
WORKDIR /opt/app | ||||||||||||||||||
RUN yarn install | ||||||||||||||||||
COPY . /opt/app | ||||||||||||||||||
Comment on lines
+4
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optimize Docker layer caching by copying COPY package.json yarn.lock /opt/app/
RUN yarn install
+ COPY . /opt/app Committable suggestion
Suggested change
|
||||||||||||||||||
CMD ["node", "index.js"] | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,11 @@ | ||||||||
#!/bin/sh | ||||||||
|
||||||||
if [[ -z "${JAVA_OPTS}" ]];then | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script uses - #!/bin/sh
+ #!/bin/bash Committable suggestion
Suggested change
|
||||||||
export JAVA_OPTS="-Xmx64m -Xms64m" | ||||||||
fi | ||||||||
|
||||||||
if [ x"${JAVA_ENABLE_DEBUG}" != x ] && [ "${JAVA_ENABLE_DEBUG}" != "false" ]; then | ||||||||
java_debug_args="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUG_PORT:-5005}" | ||||||||
fi | ||||||||
|
||||||||
exec java ${java_debug_args} ${JAVA_OPTS} ${JAVA_ARGS} -jar /opt/egov/*.jar | ||||||||
Comment on lines
+7
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script effectively handles Java options and debugging. Consider documenting the environment variables ( |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>egov-dss-dashboards</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
</natures> | ||
</projectDescription> |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more recent version of Node.js to ensure security and compatibility. Node.js 8.12 is outdated and may not receive security updates.
Committable suggestion