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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM codenvy/jdk7:latest
COPY build/libs/*.jar .
ENTRYPOINT ["java", "-jar", "gradle-simple-2.0-sources.jar"]
73 changes: 73 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
pipeline {
agent any

tools {
gradle "gradle7"
}

options {
timeout(time: 10, unit: 'MINUTES')
timestamps()
}

triggers { pollSCM('*/1 * * * *') }

environment {
DOCKER_IMAGE = "venu/helloworld-gradle"
}

stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/develop']], extensions: [], userRemoteConfigs: [[credentialsId: 'GitHub_token', url: 'https://github.com/vgtstl/java-hello-world-with-gradle.git']]])
}
}
stage('Version') {
steps {
sh 'gradle --version'
}
}
stage('Build') {
steps {
sh 'gradle clean build'
}
post {
always {
archiveArtifacts artifacts: 'build/libs/*.jar', followSymlinks: false
}
}
}
stage('DockerBuild'){
steps {
sh "docker build -t ${env.DOCKER_IMAGE} ."
}
}
stage('DockerScan'){
steps {
echo "docker scan ${env.DOCKER_IMAGE}"
}
}
stage('DockePush'){
steps {
echo "docker push ${env.DOCKER_IMAGE}"
}
}
stage('Deploy to Dev'){
steps {
echo 'Dev Deployment Completed'
}
}
stage('Deploy to QA'){
steps {
echo 'QA Deployment Completed'
}
}
stage('Deploy to Prod'){
steps {
input('Do you wants to proceed with prod deployment')
echo 'Prod Deployment Completed'
}
}
}

}