-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepareSetup.sh
More file actions
executable file
·30 lines (18 loc) · 953 Bytes
/
prepareSetup.sh
File metadata and controls
executable file
·30 lines (18 loc) · 953 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
echo "This script prepares the .env File for docker-compose and the preloadPlugins.sh script"
JENKINS_VERSION="2.150.2"
read -e -p "Please enter your Jenkins-Version (2.150.2) : " -i $JENKINS_VERSION GIVEN_JENKINS_VERSION
MAJOR=$(echo $GIVEN_JENKINS_VERSION | cut -d. -f1)
MINOR=$(echo $GIVEN_JENKINS_VERSION | cut -d. -f2)
REVISION=$(echo $GIVEN_JENKINS_VERSION | cut -d. -f3)
echo "#Autogenerated by $0"
echo "MAJOR=$MAJOR" > jenkins.env
echo "MINOR=$MINOR" >> jenkins.env
echo "REVISION=$REVISION" >> jenkins.env
echo "JENKINS_VERSION=$GIVEN_JENKINS_VERSION" > .env
## Prepare Dockerfile
. ./jenkins.env
cp jenkins/Dockerfile.template jenkins/Dockerfile
sed -i s#JENKINS_VERSION#${MAJOR}.${MINOR}.${REVISION}#g jenkins/Dockerfile
sed -i s#CACHE_NAME#${MAJOR}.${MINOR}#g jenkins/Dockerfile
echo "Dockerfile prepared run docker-compose up --build "
echo "If you want to preload all the Plugins and save time start preLoadPlugins.sh now"