diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7bfef3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +"# ci-cd" diff --git a/mynewfile b/mynewfile index 7c403ba..9f152cc 100644 --- a/mynewfile +++ b/mynewfile @@ -1,4 +1,54 @@ -hello world -asdfasdf -hello world -hello world +pipeline { + agent any + + stages { + stage('Check Versions') { + steps { + script { + echo "Checking System Environment..." + + // 1. Check Java Version + powershell "java -version" + + // 2. Check Git Version + powershell "git --version" + + // 3. Check Jenkins Status (Assuming it's running as a Windows Service) + // This checks if the service is 'Running' + powershell "Get-Service -Name jenkins" + + // 4. Check Docker Version + powershell "docker --version" + } + } + } + + stage('Check Git Branch') { + steps { + // 5. Check Git Branch + // This shows the current branch of the workspace + powershell "git branch --show-current" + } + } + + stage('Copy Directory') { + steps { + // 6. Copy Directory + // -Recurse copies subfolders; -Force overwrites if files exist + echo "Copying resume files..." + powershell ''' + $source = "D:\\devops-resume-sanam" + $destination = "D:\\Jenkins" + + if (Test-Path $source) { + Copy-Item -Path $source -Destination $destination -Recurse -Force + Write-Host "Copy Complete." + } else { + Write-Error "Source path not found!" + exit 1 + } + ''' + } + } + } +} diff --git a/pom.xml b/pom.xml index 9b804c1..9dfa97a 100644 --- a/pom.xml +++ b/pom.xml @@ -65,11 +65,11 @@ maven-releases - http://15.207.82.70:8081/repository/maven-releases/ + http://localhost:8081/repository/maven-releases/ maven-snapshots - http://15.207.82.70:8081/repository/maven-snapshots/ + http://localhost:8081/repository/maven-snapshots/ diff --git a/sourcecode b/sourcecode new file mode 100644 index 0000000..8356911 --- /dev/null +++ b/sourcecode @@ -0,0 +1,16 @@ +pipeline { + agent any + + stages { + stage('checkout the source code') { + steps { + git branch: 'main', url: 'https://github.com/sam358-crypto/Project1' + } + } + stage ("create package") { + steps { + powershell 'mvn package' + } + } + } + } diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 7aa8913..6a1da24 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,7 +1,7 @@ - DevOps Job Application + DevOps Engineer yes