Unverified Commit 44f4da32 authored by nasirhm's avatar nasirhm

🔧 👷 Seedjob

Signed-off-by: 's avatarnasirhm <nasirhussainm14@gmail.com>
parent be804267
FROM nginx:1.19.6
COPY my-application /usr/share/nginx/html
pipeline {
agent any
stages {
stage('Docker Build and Tag') {
steps {
sh 'docker build -t my-application:latest .'
sh 'docker tag my-application my-application:$BUILD_NUMBER'
}
}
stage('Stop Previous Container and Rename for rollback') {
steps {
sh 'docker kill my-application'
sh 'docker rename my-application my-application-last'
}
}
stage('Run Docker Container on Jenkins Agent') {
steps {
sh 'docker run --name my-application -d -p 80:80 my-application'
}
}
}
}
Learning Task
\ No newline at end of file
<head>
<title>Hello World, It's my Application</title>
</head>
<body>
<h1>Hello World, It's my Application </h1>
</body>
folder('My-Project') {
displayName('My Project')
description('Project for me')
}
pipelineJob('My-Project/job-dsl-plugin') {
definition {
cpsScm {
scm {
git {
remote {
url('https://gitlab.mynisum.com/nhussain/jenkins-learning-project.git')
}
branch('*/master')
}
}
lightweight()
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment