Skip to content
Merged
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: 0 additions & 1 deletion jenkins-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
volumes:
- jenkins_home:/var/jenkins_home
- ./jenkins/casc.yaml:/var/jenkins_home/casc/casc.yaml
- ./pipelines:/var/jenkins_home/pipelines
- /var/run/docker.sock:/var/run/docker.sock
volumes:
jenkins_home:
2 changes: 1 addition & 1 deletion jenkins-setup/jenkins/casc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
remote {
url("https://github.com/mastershashi/devOps.git")
}
branches("*/main")
branches("*/master")
}
}
scriptPath("jenkins-setup/pipelines/Jenkinsfile")
Expand Down
63 changes: 61 additions & 2 deletions jenkins-setup/pipelines/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,78 @@
pipeline {
agent any

environment {
DOCKER_IMAGE = "yourdockerhubuser/yourapp"
DOCKER_TAG = "latest"
}

stages {
stage('Build') {
steps {
echo "✅ Building the app..."
// build your app here
}
}

stage('Test') {
steps {
echo "🧪 Running tests..."
// run tests here
}
}

stage('Docker Build') {
steps {
script {
echo "🐳 Building Docker image..."
sh "docker build -t $DOCKER_IMAGE:$DOCKER_TAG ."
}
}
}

stage('Push to Docker Hub') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerhub-creds', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
sh """
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
docker push $DOCKER_IMAGE:$DOCKER_TAG
"""
}
}
}

stage('Deploy to Dev/Staging') {
steps {
echo "🚀 Deploying to staging environment..."
// deployment script/command
}
}

stage('Approval & Deploy to EU10') {
steps {
input message: "Deploy to EU10?", ok: "Deploy"
echo "🚀 Deploying to EU10..."
}
}

stage('Approval & Deploy to EU20') {
steps {
input message: "Deploy to EU20?", ok: "Deploy"
echo "🚀 Deploying to EU20..."
}
}

stage('Approval & Deploy to US10') {
steps {
input message: "Deploy to US10?", ok: "Deploy"
echo "🚀 Deploying to US10..."
}
}
stage('Deploy') {

stage('Approval & Deploy to US20') {
steps {
echo "🚀 Deploying to environment..."
input message: "Deploy to US20?", ok: "Deploy"
echo "🚀 Deploying to US20..."
}
}
}
Expand Down
Loading