Skip to content

Commit

Permalink
Issue sunbird-cb#1 fix : Update Jenkinsfiles and Dockerfiles for cont…
Browse files Browse the repository at this point in the history
…ent service
  • Loading branch information
Manojvv committed Sep 11, 2017
1 parent bef2735 commit 86d840b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ EXPOSE 27017
EXPOSE 5000
#RUN rm /home/sunbird/mw/content/services/js-services/content_service/content_service.zip
#RUN rm /home/sunbird/mw/content_service.zip
WORKDIR /home/sunbird/mw/content/src
WORKDIR /home/sunbird/mw/content/
CMD ["node", "app.js", "&"]
5 changes: 3 additions & 2 deletions Dockerfile.Build
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ MAINTAINER "Manojvv" "[email protected]"
RUN apk update \
&& apk add zip \
&& mkdir -p /opt/content
ADD content /opt/content/
WORKDIR /opt/content/src
ADD src /opt/content/
ADD sunbird-js-utils /opt/content/
WORKDIR /opt/content/
RUN npm install --unsafe-perm
WORKDIR /opt
CMD ["zip", "-r", "content_service.zip", "content"]
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ node('build-slave') {
env.NODE_ENV = "build"

print "Environment will be : ${env.NODE_ENV}"
sh('chmod 777 content/build.sh')
sh('./content/build.sh')
sh('chmod 777 build.sh')
sh('./build.sh')

}

Expand All @@ -28,9 +28,9 @@ node('build-slave') {

dir('.') {

sh('chmod 777 ./content/dockerPushToRepo.sh')
sh 'ARTIFACT_LABEL=bronze ./content/dockerPushToRepo.sh'
sh './content/src/metadata.sh > metadata.json'
sh('chmod 777 ./dockerPushToRepo.sh')
sh 'ARTIFACT_LABEL=bronze ./dockerPushToRepo.sh'
sh './src/metadata.sh > metadata.json'
sh 'cat metadata.json'
archive includes: "metadata.json"
}
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
e () {
echo $( echo ${1} | jq ".${2}" | sed 's/\"//g')
}
m=$(./content/src/metadata.sh)
m=$(./src/metadata.sh)

org=$(e "${m}" "org")
name=$(e "${m}" "name")
version=$(e "${m}" "version")


docker build -f ./Dockerfile.Build -t ${org}/${name}:${version}-build .
docker run --name=${name}-${version}-build ${org}/${name}:${version}-build
containerid=`docker ps -aqf "name=${name}-${version}-build"`
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
e () {
echo $( echo ${1} | jq ".${2}" | sed 's/\"//g')
}
m=$(./content/src/metadata.sh)
m=$(./src/metadata.sh)

org=$(e "${m}" "org")
name=$(e "${m}" "name")
Expand Down
2 changes: 1 addition & 1 deletion dockerPushToRepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
e () {
echo $( echo ${1} | jq ".${2}" | sed 's/\"//g')
}
m=$(./content/src/metadata.sh)
m=$(./src/metadata.sh)

org=$(e "${m}" "org")
hubuser=$(e "${m}" "hubuser")
Expand Down

0 comments on commit 86d840b

Please sign in to comment.