-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.sh
More file actions
30 lines (26 loc) · 763 Bytes
/
notes.sh
File metadata and controls
30 lines (26 loc) · 763 Bytes
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
#!/bin/bash
# problematic code
# [ -z "$JOBS" ] && echo "No job definitions" || for job in $JOBS; do
# jenkins-jobs update $JENKINS_HOME/jenkins_jobs_definitions/$job
# done
JOBS="1 2 3 4"
if [ -z "$JOBS" ]
then
echo "No job definitions"
else
for job in $JOBS; do
echo "$job"
done
fi
# problematic code
# [ -z "$PLUGINS" ] && echo "No required plugin" || for plugin in $PLUGINS; do
# java -jar jenkins-cli.jar -s http://localhost:8080/ -auth admin:$ADMIN_PASSWORD install-plugin $plugin -deploy
# done
if [ -z "$PLUGINS" ]
then
echo "No required plugin"
else
for plugin in $PLUGINS; do
java -jar jenkins-cli.jar -s http://localhost:8080/ -auth admin:$ADMIN_PASSWORD install-plugin $plugin -deploy
done
fi