내용 추가
This commit is contained in:
58
pipline_script.jenkinsfile
Normal file
58
pipline_script.jenkinsfile
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent none
|
||||||
|
stages {
|
||||||
|
stage('Git Clone Task') {
|
||||||
|
agent { node { label 'junghun-cicd-podman' } }
|
||||||
|
steps {
|
||||||
|
git credentialsId: 'gitid',
|
||||||
|
url: 'https://gitlab.dev-cloudps.com/root/bookinfo.git',
|
||||||
|
branch: 'main'
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
failure {
|
||||||
|
echo 'Fail!'
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
echo 'Done!'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Podman Build') {
|
||||||
|
agent { node { label 'junghun-cicd-podman' } }
|
||||||
|
steps {
|
||||||
|
container('podman') {
|
||||||
|
sh './build-services.sh ${BUILD_NUMBER} harbor.dev-cloudps.com/reviews/reviews'
|
||||||
|
sh 'podman login harbor.dev-cloudps.com -u admin -p admin'
|
||||||
|
sh 'podman push harbor.dev-cloudps.com/reviews/reviews:${BUILD_NUMBER}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Argo Upload') {
|
||||||
|
agent { node { label 'junghun-cicd-argo' } }
|
||||||
|
steps {
|
||||||
|
container('upload') {
|
||||||
|
sh '''
|
||||||
|
git config --global --add safe.directory /home/jenkins/argo/workspace/cicdtest
|
||||||
|
git config --global user.email "sa_8001@jhcloud.kr"
|
||||||
|
git config --global user.name "junghun_test"
|
||||||
|
git clone https://root:platformps@gitlab.dev-cloudps.com/root/appyaml.git
|
||||||
|
'''
|
||||||
|
dir(appyaml) {
|
||||||
|
sh 'ls -l'
|
||||||
|
sh 'pwd'
|
||||||
|
sh '''
|
||||||
|
rm -rf app.yaml
|
||||||
|
cp app.yaml.template app.yaml
|
||||||
|
sed -i 's@{{URL}}@harbor.dev-cloudps.com/reviews/reviews:${BUILD_NUMBER}@' app.yaml
|
||||||
|
git add *
|
||||||
|
git status
|
||||||
|
git commit -m 'Images & Version Changed'
|
||||||
|
git push -u origin master
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Git Clone Task') {
|
|
||||||
steps {
|
|
||||||
git credentialsId: 'gitid',
|
|
||||||
url: 'http://gitlab.dev-cloudps.com/root/bookinfo.git',
|
|
||||||
branch: 'main'
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
failure {
|
|
||||||
echo 'Fail!'
|
|
||||||
}
|
|
||||||
success {
|
|
||||||
echo 'Done!'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user