This commit is contained in:
parent
2a2aea4757
commit
2f76919c1e
|
|
@ -1,20 +1,20 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent any
|
||||||
node {
|
|
||||||
label 'agent-1'
|
|
||||||
customWorkspace './agent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
environment {
|
environment {
|
||||||
DOCKER_IMAGE = 'my-local-image-name'
|
DOCKER_IMAGE = 'docker.cloud.pokash.pl/szkolenia.riskoff.pl'
|
||||||
|
DOCKER_REGISTRY = 'https://docker.cloud.pokash.pl'
|
||||||
GIT_REPO = 'https://repo.pokash.pl/POKASH.PL/SzkoleniaRiskoff.git'
|
GIT_REPO = 'https://repo.pokash.pl/POKASH.PL/SzkoleniaRiskoff.git'
|
||||||
|
REGISTRY_CREDENTIALS_ID = '2753fc17-5ad1-4c78-b86a-a3e54c543adc' // ID poświadczeń do lokalnego rejestru
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
git url: "${GIT_REPO}", branch: 'main'
|
git url: "${GIT_REPO}", branch: 'main'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Docker Image') {
|
stage('Build Docker Image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
|
@ -22,10 +22,22 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Push Docker Image') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// Logowanie do lokalnego rejestru
|
||||||
|
docker.withRegistry("http://${DOCKER_REGISTRY}", "${REGISTRY_CREDENTIALS_ID}") {
|
||||||
|
docker.image("${DOCKER_IMAGE}:latest").push('latest')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
cleanWs()
|
cleanWs() // Czyści workspace po zakończeniu builda
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue