initial Jenkinsfile

This commit is contained in:
GasparAM 2023-04-14 14:13:28 +04:00
parent 0e2cec00a4
commit 6e4d8661ee

51
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,51 @@
pipeline {
agent any
triggers {
pollSCM '*/5 * * * *'
}
stages {
stage('Checkstyle') {
steps {
sh '''
./mvnw checkstyle:checkstyle
'''
}
}
stage('Test') {
steps {
sh '''
./mvnw test
'''
}
}
stage('Build') {
steps {
sh '''
./mvnw clean package
'''
}
}
stage('Docker up') {
steps {
sh '''
docker build -t "gavetisyangd/main:${GIT_COMMIT}" ./
'''
}
}
stage('Push') {
steps {
withCredentials([string(credentialsId: 'dhub', variable: 'TOKEN')]) {
sh '''
echo $TOKEN | docker login -u gavetisyangd --password-stdin
'''
}
}
}
}
}