diff --git a/pipline_script.jenkinsfile b/pipline_script.jenkinsfile new file mode 100644 index 0000000..11d7730 --- /dev/null +++ b/pipline_script.jenkinsfile @@ -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 + ''' + } + } + } + } + } +} \ No newline at end of file diff --git a/pipline_script.txt b/pipline_script.txt deleted file mode 100644 index a4a4d5b..0000000 --- a/pipline_script.txt +++ /dev/null @@ -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!' - } - } - } - } -} \ No newline at end of file