Alberga una configuración de Gitea y Jenkins para pruebas ci/cd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
841 B

pipeline {
options {
ansiColor('xterm')
}
agent {
kubernetes {
yamlFile 'builder.yaml'
}
}
stages {
stage('Kaniko Build & Push Image') {
steps {
container('kaniko') {
script {
sh '''
/kaniko/executor --dockerfile `pwd`/Dockerfile \
--context `pwd` \
--destination=registry.reymota.es/nginx_kaniko:${BUILD_NUMBER}
'''
}
}
}
}
stage('Deploy App to Kubernetes') {
steps {
container('kubectl') {
withCredentials([file(credentialsId: 'mykubeconfig', variable: 'KUBECONFIG')]) {
sh 'sed -i "s/<TAG>/${BUILD_NUMBER}/" myweb.yaml'
sh 'kubectl apply -f myweb.yaml'
}
}
}
}
}
}