Skip to content

Commit 04a8043

Browse files
committed
improvement of setup-Script
- let you choose the number of plugins for jenkins - give you time to read the output
1 parent 4ed1ef1 commit 04a8043

File tree

3 files changed

+54
-98
lines changed

3 files changed

+54
-98
lines changed

.env.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# This is the Environment for the docker-compos-file:
2-
# autogenerated ...do NOT edit
1+
# This is the environment-file for the docker-compose.yaml
2+
# autogenerated ... via setupEnvironmen.sh
3+
# if you edit this file your changes are lost after next setupEnvironmen.sh run

jenkins-fat/active-plugins.txt

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +0,0 @@
1-
ace-editor
2-
ant
3-
antisamy-markup-formatter
4-
apache-httpcomponents-client-4-api
5-
authentication-tokens
6-
bouncycastle-api
7-
branch-api
8-
build-timeout
9-
cloudbees-folder
10-
command-launcher
11-
credentials
12-
credentials-binding
13-
display-url-api
14-
docker-commons
15-
docker-workflow
16-
durable-task
17-
email-ext
18-
git
19-
git-client
20-
github
21-
github-api
22-
github-branch-source
23-
git-server
24-
gradle
25-
handlebars
26-
jackson2-api
27-
jquery-detached
28-
jsch
29-
junit
30-
ldap
31-
mailer
32-
mapdb-api
33-
matrix-auth
34-
matrix-project
35-
momentjs
36-
pam-auth
37-
pipeline-build-step
38-
pipeline-github-lib
39-
pipeline-graph-analysis
40-
pipeline-input-step
41-
pipeline-milestone-step
42-
pipeline-model-api
43-
pipeline-model-declarative-agent
44-
pipeline-model-definition
45-
pipeline-model-extensions
46-
pipeline-rest-api
47-
pipeline-stage-step
48-
pipeline-stage-tags-metadata
49-
pipeline-stage-view
50-
plain-credentials
51-
resource-disposer
52-
scm-api
53-
script-security
54-
ssh-credentials
55-
ssh-slaves
56-
structs
57-
subversion
58-
timestamper
59-
token-macro
60-
windows-slaves
61-
workflow-aggregator
62-
workflow-api
63-
workflow-basic-steps
64-
workflow-cps
65-
workflow-cps-global-lib
66-
workflow-durable-task-step
67-
workflow-job
68-
workflow-multibranch
69-
workflow-scm-step
70-
workflow-step-api
71-
workflow-support
72-
ws-cleanup

setupEnvironment.sh

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
function pause(){
4+
read -p "Press [Enter] key to continue..."
5+
}
6+
37
if [ $(id -u) -gt 0 ] ;then
48
echo "Use sudo $0 "
59
exit 1
@@ -14,12 +18,14 @@ HOSTIP=$(hostname -I | awk '{print $1}' )
1418

1519
echo "########################################################################"
1620
echo "Verify your hostname and the ip is correct, if this is wrong the "
17-
echo "container network ist not able to lookup the host $(hostname) by name "
21+
echo "container network ist not able to lookup the host \"$(hostname) \" by name "
1822
echo "it's a docker-Feature !!"
1923
echo "the \"routing \" ist out of container an back into the nginx and forward to container:-) "
2024
echo " and 8.8.8.8 (Google Nameserver) does not known your internal hostname "
2125
echo "########################################################################"
2226

27+
pause
28+
2329
read -e -p "Your hostname (hit return if $HOSTNAME is correct) : " -i $HOSTNAME GIVEN_HOSTNAME
2430
echo "Setting HOSTNAME to $GIVEN_HOSTNAME"
2531
HOSTNAME=$GIVEN_HOSTNAME
@@ -31,19 +37,32 @@ read -e -p "Your hostIP : " -i $HOSTIP GIVEN_HOSTIP
3137
HOSTIP=$GIVEN_HOSTIP
3238
echo "Setting HOSTIP to $GIVEN_HOSTIP"
3339
echo " "
34-
echo "Number of plugins to download for Jenkins (S)uggessted (72 Plugin)"
35-
echo " (M)uch more (146 Plugins)"
40+
echo "Choose your weapons: Number of plugins to download for Jenkins "
41+
echo " (L)et _ME_ choose (0 Plugins)"
42+
echo " (S)uggested (72 Plugins)"
43+
echo " (M)uch more (146 Plugins)"
3644
PLUGINS=S
3745
read -e -p "Choose S or M : " -i $PLUGINS GIVEN_PLUGINS
38-
if [ "$GIVEN_PLUGINS" == "S" ] ; then
39-
echo "using suggested plugins"
40-
cp jenkins-fat/suggested-plugins.txt jenkins-fat/active-plugins.txt
41-
else
42-
echo "using a lot lot lot of more plugins"
43-
cp jenkins-fat/max-plugins.txt jenkins-fat/active-plugins.txt
44-
fi
46+
47+
case $GIVEN_PLUGINS in
48+
"L")
49+
echo "Choose your own weapons (Jenkins will ask...you choose)"
50+
> jenkins-fat/active-plugins.txt
51+
;;
52+
"S")
53+
echo "Jenkins will ask you, just say OK to use suggested plugins"
54+
cp jenkins-fat/suggested-plugins.txt jenkins-fat/active-plugins.txt
55+
;;
56+
"M")
57+
echo "Jenkins will ask you, just say OK to use tons of plugins"
58+
cp jenkins-fat/max-plugins.txt jenkins-fat/active-plugins.txt
59+
;;
60+
esac
61+
4562
chmod a+rw jenkins-fat/active-plugins.txt
4663

64+
pause
65+
4766
type openssl 2>/dev/null
4867
if [ $? -eq 0 ] ; then
4968
echo "openssl installed :-)"
@@ -61,7 +80,9 @@ mkdir -p $USER_DATA_DIR/nexus
6180
chown -R 200 $USER_DATA_DIR/nexus
6281
#----------------------------------
6382

64-
echo "Create a self-signed certificate for your host: $HOSTNAME to "
83+
echo "Create a self-signed certificate for your host: $HOSTNAME to prevent docker complaining unsecure (gitlab) registry "
84+
pause
85+
6586
if [ -f $USER_DATA_DIR/gitlab/config/ssl/$(hostname).key ]; then
6687
FILE_NAME=$USER_DATA_DIR/gitlab/config/ssl/$(hostname).key-$(date +"%F-%H-%M-%S-%N")
6788
cp $USER_DATA_DIR/gitlab/config/ssl/$(hostname).key $USER_DATA_DIR/gitlab/config/ssl/$(hostname).key-$(date +"%F-%H-%M-%S-%N")
@@ -83,6 +104,7 @@ if [ $? -eq 0 ] ;then
83104
echo "----------- Your certificate used by Gitlab docker-registry@${HOSTNAME} -------------------"
84105
openssl x509 -in $USER_DATA_DIR/gitlab/config/ssl/$(hostname).crt -text | head -15
85106
echo "-------------------------------------------------------------------------------------------"
107+
pause
86108
else
87109
echo "NO CERT GENERATED "
88110
exit 1
@@ -111,27 +133,32 @@ cat .env.template > .env
111133
echo "DC_HOSTNAME=${HOSTNAME}" >> .env
112134
echo "DC_HOSTIP=${HOSTIP}" >> .env
113135
echo "DC_BASE_DATA_DIR=${USER_DATA_DIR}" >> .env
114-
echo "---------- genarated file ---------------------------- "
136+
echo "---------- generated file ---------------------------- "
115137
cat .env
116138
echo "-------------------------------------------------------------------------------------------"
117-
118-
#sed s#BASE_DATA_DIR#${USER_DATA_DIR}#g docker-compose.yml.template > docker-compose.yml
119-
#sed -i s#HOSTIP#${HOSTIP}#g docker-compose.yml
120-
#sed -i s#HOSTNAME#${HOSTNAME}#g docker-compose.yml
121-
122-
# Gitlabrunner needs extra_hosts to clone stuff via (outside) hostname
123-
# sed -i s#HOSTNAME#${HOSTNAME}#g gitlabrunner/entrypointAutoregister
124-
# sed -i s#HOSTIP#${HOSTIP}#g gitlabrunner/entrypointAutoregister
139+
echo "If something changed (your IP / hostname ... ) just edit the .env or rerun the script."
125140

126141
echo "-------------------------------------------------------------------------------------------"
127142
echo "-------------------------------------------------------------------------------------------"
128-
echo "Evironment for docker-compose.yml created"
129-
echo "run "
130-
echo "docker-compose up --build -d "
131-
echo "docker-compose logs -f"
143+
echo "Environment for docker-compose.yml created"
144+
echo " "
132145
echo "use the following URL"
133146
BASE_URL="http://"$(hostname)"/"
134147
echo "Jenkins: ${BASE_URL}jenkins"
135148
## echo "Sonar : ${BASE_URL}sonar"
136149
echo "Nexus : ${BASE_URL}nexus"
137150
echo "Gitlab : ${BASE_URL}gitlab"
151+
echo "Feel free to provide push-requests :-)"
152+
pause
153+
echo " "
154+
155+
echo "Setup finished, just type the following commands to start and see the logs of your environment"
156+
echo "docker-compose up --build -d "
157+
echo "docker-compose logs -f"
158+
159+
160+
161+
162+
163+
164+

0 commit comments

Comments
 (0)