Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"# ci-cd"
58 changes: 54 additions & 4 deletions mynewfile
Original file line number Diff line number Diff line change
@@ -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
}
'''
}
}
}
}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
<distributionManagement>
<repository>
<id>maven-releases</id>
<url>http://15.207.82.70:8081/repository/maven-releases/</url>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<url>http://15.207.82.70:8081/repository/maven-snapshots/</url>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
16 changes: 16 additions & 0 deletions sourcecode
Original file line number Diff line number Diff line change
@@ -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'
}
}
}
}
6 changes: 3 additions & 3 deletions src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>DevOps Job Application</title>
<title>DevOps Engineer yes</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<style>
Expand All @@ -14,8 +14,8 @@
margin: 0;
outline: none;
font-family: Roboto, Arial, sans-serif;
font-size: 60px;
color: #012;
font-size: 6px;
color: #018;
line-height: 40px;
}
h1 {
Expand Down