-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathextension.json
115 lines (110 loc) · 3.4 KB
/
extension.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"id": "ibm.devops.services.pipeline.appscan.static.builder",
"version": 1,
"name_key": "ExtName",
"desc_key": "ExtDesc",
"extension_type": "Test",
"message_key": "ExtMessage",
"inputs": [
{
"type": "Bluemix",
"inclusion" : "always"
}
],
"params": [
{
"name": "SETUP_SERVICE_SPACE",
"type": "Checkbox",
"required": "true",
"default_value": "false",
"label_key": "ACCEPT_KEY",
"desc_key": "ACCEPT_DESC"
},
{
"name": "WAIT_TIME",
"type": "Text",
"required": "false",
"default_value": "5",
"label_key": "WAIT_TIME_KEY",
"desc_key": "WAIT_TIME_DESC"
}
],
"outputs": [
{
"type": "Artifacts",
"inclusion" : "always"
}
],
"execution": {
"type": "JenkinsDocker",
"shell": "#!/bin/bash
set +x
set +e
export INIT_START_TIME=$(date +\"%s\")
export SETUP_SERVICE_SPACE=#SETUP_SERVICE_SPACE#
export WAIT_TIME=#WAIT_TIME#
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist
. $EXT_DIR/_init.sh
# OSSC line
dpkg -l | grep '^ii' > $EXT_DIR/pkglist2
if [[ $DEBUG -eq 1 ]]; then
diff $EXT_DIR/pkglist $EXT_DIR/pkglist2
fi
INIT_END_TIME=$(date +\"%s\")
export INIT_EST_TIME=$(($INIT_END_TIME-$INIT_START_TIME))
log_and_echo \"$INFO\" \"Init runtime of `date -u -d @\"$INIT_EST_TIME\" +\'%-Mm %-Ss\'`\"
log_and_echo \"$INFO\" \"Starting test script\"
# helper function to print the end time for this script
end_script_time() {
SCRIPT_END_TIME=$(date +\"%s\")
SCRIPT_EST_TIME=$(($SCRIPT_END_TIME-$INIT_END_TIME))
log_and_echo \"$INFO\" \"Script runtime of `date -u -d @\"$SCRIPT_EST_TIME\" +\'%-Mm %-Ss\'`\"
}
# Calls OTC api to determine if DRA is present.
callOpenToolchainAPI
# run the python IBM Security Static Analyzer checker, dump results on output
if [ -f ${EXT_DIR}/appscan_check.py ]; then
if [[ $DEBUG -eq 1 ]]; then
${EXT_DIR}/appscan_check.py --debug
else
${EXT_DIR}/appscan_check.py
fi
RESULT=$?
if [ \"${ARCHIVE_DIR}\" == \"${WORKSPACE}\" ]; then
log_and_echo \"$INFO\" \"Achive directory is the working directory\"
else
log_and_echo \"$INFO\" \"Archive directory is $ARCHIVE_DIR - copying all content to that directory\"
pushd ${WORKSPACE} &> /dev/null
# also copy .git metadata
if [ -d .git ]; then
tar -cf source.tar * .git
else
tar -cf source.tar *
fi
mv source.tar ${ARCHIVE_DIR}
cd ${ARCHIVE_DIR}
tar -xf source.tar
rm source.tar
popd &> /dev/null
fi
if [ $RESULT -ne 0 ]; then
log_and_echo \"$ERROR\" \"Error running IBM Security Static Analyzer\"
end_script_time
exit 1
else
log_and_echo \"$SUCCESSFUL\" \"Application scan was successful\"
fi
else
log_and_echo \"$ERROR\" \"IBM Security Static Analyzer helper script not available, failed.\"
${EXT_DIR}/utilities/sendMessage.sh -l good -m \"IBM Security Static Analyzer helper script not available, failed.\"
end_script_time
exit 1
fi
"
}
},
"project": "https://hub.jazz.net/project/alchemy/Alchemy-Ostanes",
"project_example": "https://hub.jazz.net/pipeline/rjminsha/ice-pipeline_demo",
"project_contact": "[email protected]"
}