Skip to content

Commit

Permalink
Added jenkins with dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
vikash-galaxyweblinks committed Sep 3, 2023
1 parent a4cb783 commit e7c2cdf
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Jenkinsfile-dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pipeline{
agent {
dockerfile {
dir '.'
filename 'Dockerfile-agent'
label 'agent-ssh'
}
}
stages{
stage('Preparing Container'){
steps{
echo 'Hello from docker container'
sh 'whoami'
sh 'apt-get update -y'
sh 'apt-get install openjdk-17-jdk -y'
sh 'java -version'
sh 'apt-get install wget -y'
sh 'wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz'
sh 'tar -xvf apache-maven-3.6.3-bin.tar.gz'
sh 'mv apache-maven-3.6.3 /opt/'
sh 'export PATH=/opt/apache-maven-3.6.3/bin:${PATH}'
sh 'ls /opt'
sh 'ls /opt/apache-maven-3.6.3'
sh '/opt/apache-maven-3.6.3/bin/mvn -version'
}
}
stage('Checkout'){
steps{
checkout poll: false, scm: scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/vcjain/docker-agent-demo.git']])
}
}
stage('Build'){
steps{
echo "Build Stage is in progress "
sh '/opt/apache-maven-3.6.3/bin/mvn compile'
}
}
}

}

0 comments on commit e7c2cdf

Please sign in to comment.