- Install Jenkins using Docker
sudo docker run --restart always -p 8081:8080 --name=jenkins -d \
-v /var/www/html:/var/www/html \
--env JAVA_OPTS="-Xmx4092m" --env JENKINS_OPTS="--prefix=/jenkins" jenkins/jenkins
Get password from tail logs command.docker logs --tail 100 -f <container_name>
- Install Jenkins Recommend plugin.
- Install ZTI’s Recommend plugin.
Manage Jenkins > Plugin Manager > Available Tab- Gitlab
- Deploy to container
- Maven Integration
- Publish over SSH
- Publish over FTP
- Install Node in docker
docker exec -it -u root <container_name> bash
apt-update
apt install curl -y
apt install wget -y
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt install nodejs - Install Maven in docker
docker exec -it -u root <container_name> bash
apt install unzip -y
cd /opt
wget http://www-eu.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
unzip apache-maven-3.5.4-bin.zip
mv apache-maven-3.5.4 maven
chown -R root:root /opt/mavenecho 'export PATH=$PATH:/opt/maven/bin' | tee -a /etc/profile
source /etc/profile
mvn --version - Install Maven
Global Tool Configuration > Maven > Maven Installations > Add Maven
Name : MVN
MAVEN_HOME : /opt/maven - Add Jenkins Credentials Provider: Jenkins
Manage Jenkins > Credentials > System > Global Credentials (Unrestrict) - Add SSH path (If needed).
Go to Manage Jenkins > Configure System