-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathextension.json
89 lines (84 loc) · 2.19 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
{
"id": "ibm.devops.services.pipeline.bluemix.shell",
"version": 2,
"name_key": "ExtName",
"desc_key": "ExtDesc",
"extension_type": "Test",
"message_key": "ExtMessage",
"inputs": [
{
"type": "Bluemix",
"inclusion" : "always"
}
],
"params": [
{
"name": "COMMAND",
"type": "TextArea",
"required": "true",
"default_value" : "#!/bin/bash
# list running cloud foundry applications
cf apps
if [ \"$CONTAINERS_SUPPORTED\" = true ]; then
# list running container groups
ice_retry group list
# list running applications
ice_retry ps
fi
${EXT_DIR}/utilities/sendMessage.sh -l good -m \"installing the BlueMix command line (cloud-cli) completed successful\"
",
"label_key": "COMMAND_KEY",
"desc_key": "COMMAND_DESC"
}
],
"outputs": [
{
"type": "Artifacts",
"inclusion" : "always"
},
{
"type": "Tests",
"inclusion": "optional"
}
],
"execution": {
"type": "JenkinsDocker",
"shell": "#!/bin/bash
set +x
set +e
export INIT_START_TIME=$(date +\"%s\")
# 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\")
INIT_EST_TIME=$(($INIT_END_TIME-$INIT_START_TIME))
echo -e \"Init runtime of `date -u -d @\"$INIT_EST_TIME\" +\'%-Mm %-Ss\'`\"
# place command into a temp script file
cat > script.sh << '__EOF__'
#!/bin/bash
function save_env_vars_on_exit() {
echo \"#!/bin/bash\" > $EXT_DIR/save_vars.sh
export -p >> $EXT_DIR/save_vars.sh
}
trap \"save_env_vars_on_exit\" EXIT
#COMMAND#
__EOF__
# call the script in a subscript
/bin/bash -e script.sh
PIPE_SCR_RESULT=$?
# restore the saved exported vars
source $EXT_DIR/save_vars.sh
if [ $PIPE_SCR_RESULT -ne 0 ]; then
exit $PIPE_SCR_RESULT
fi"
}
},
"project": "https://hub.jazz.net/project/alchemy/Alchemy-Ostanes",
"project_example": "https://github.com/Puquios",
"project_contact": "[email protected]"
}