forked from opstree/spring3hibernate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opstree#32 from opstree/bpmaven
adding generateoutput in bash.sh and installing jq in dockerfile
- Loading branch information
Showing
2 changed files
with
33 additions
and
9 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM maven:3.3-jdk-8 | ||
|
||
RUN apt-get update || true | ||
RUN apt-get install jq | ||
COPY build.sh . | ||
ENV ACTIVITY_SUB_TASK_CODE MVN_EXECUTE | ||
|
||
ENTRYPOINT [ "./build.sh" ] | ||
ENTRYPOINT [ "./build.sh" ] |
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 |
---|---|---|
@@ -1,15 +1,39 @@ | ||
#!/bin/bash | ||
|
||
#!/bin/bash | ||
|
||
generateOutput() { | ||
Task=$1 | ||
Status=$2 | ||
Message=$3 | ||
OUTPUT_DIR=/src/${EXECUTION_DIR}/${EXECUTION_TASK_ID} | ||
mkdir -p ${OUTPUT_DIR} | ||
echo "{ \"${Task}\": {\"status\": \"${Status}\", \"message\": \"${Message}\"}}" | jq . > ${OUTPUT_DIR}/summary.json | ||
echo "{ \"status\": \"${Status}\", \"message\": \"${Message}\"}" | jq . > ${OUTPUT_DIR}/${Task}.json | ||
} | ||
|
||
echo "I'll build the code" | ||
sleep $SLEEP_DURATION | ||
sleep $SLEEP_DURATION | ||
|
||
cd $CODEBASE_DIR | ||
cd $CODEBASE_DIR | ||
mvn $INSTRUCTION | ||
echo "Code building done" | ||
if [ $? -eq 0 ] | ||
then | ||
generateOutput mvn_execute true "dhek chal gya" | ||
echo "build sucessfull" | ||
elif [ $? != 0 ] | ||
then | ||
generateOutput mvn_execute false "nhi chala" | ||
echo "build unsucessfull" | ||
fi | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
OUTPUT_DIR=${EXECUTION_DIR}/${EXECUTION_TASK_ID} | ||
|
||
echo '{"mvn_execute": {"status": true, "message": "Dekha chal gaya"}}' > ${OUTPUT_DIR}/summary.json | ||
|
||
echo '{"status": true, "message": "Dekha chal gaya"}' > ${OUTPUT_DIR}/mvn_execute.output | ||
|