-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (28 loc) · 952 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pipeline {
agent {
kubernetes {
yamlFile 'deploy_agent.yaml'
defaultContainer 'docker'
}
}
stages {
stage('build docker image') {
steps {
sh 'docker buildx create --driver kubernetes --name builder --node arm64node --driver-opt replicas=1,nodeselector=kubernetes.io/arch=arm64 --use'
sh 'docker buildx create --append --driver kubernetes --name builder --node amd64node --driver-opt replicas=1,nodeselector=kubernetes.io/arch=amd64 --use'
sh 'docker buildx build --platform linux/arm64,linux/amd64 --push -t ${IMAGEREPO}/3szog_gyakorlo .'
}
}
stage('deploy on k8s') {
steps {
container(name: 'kubectl'){
sh 'kubectl apply -f k8s/deploy_haromszog.yaml'
sh 'kubectl rollout status deployment/oktatas-3szog --namespace=oktatas-3szog'
}
}
}
}
environment {
IMAGEREPO = 'registry.klucsik.fun'
}
}