要件
CIツールのJenkinsでコンパイルし、Deployする
GitLabからWebhook飛ばしてJenkinsのJobを実行す
https://qiita.com/rk05231977/items/8b87b091eb6d45a370e1
Jenkinsマシンの試し
gitlabからソースチェックアウト
git ini
git remote add origin https://sfdjp13998.swf.nec.co.jp/gitlab/ALLProjectMember/saprise_poc_java.git
git pull
git branch -a
git checkout -b dev001 origin/dev001
git
Webhook
JenkinsのToken
gitlabのWebhook
Pipeline
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/529847/78ca7c64-e77b-b9df-ca71-2d9dd6d10b6e.png)
```pipeline {
agent {
label '1201041_build1013426'
}
environment {
PATH = "C:\\Program Files\\Cloud Foundry;C:\\Program Files\\SapMachine\\JDK\\21\\BIN;${env.PATH}"
JAVA_HOME = "C:\\Program Files\\SapMachine\\JDK\\21"
HTTPS_PROXY = "http://proxygate2.nic.nec.co.jp:8080"
CF_API_ENDPOINT = "https://api.cf.jp10.hana.ondemand.com"
}
stages {
stage('Hello') {
steps {
echo 'Hello World'
echo "PATH is: ${env.PATH}"
echo "JAVA_HOME is: ${env.JAVA_HOME}"
echo "HTTPS_PROXY is: ${env.HTTPS_PROXY}"
echo "CF_API_ENDPOINT is: ${env.CF_API_ENDPOINT}"
}
}
stage('Checkout') {
steps {
script {
// The below will clone your repo and will be checked out to master branch by default.
git branch: 'master',credentialsId: '63ead174-294f-4c05-9f92-0558740f8989', url: 'https://sfdjp13998.swf.nec.co.jp/gitlab/ALLProjectMember/saprise_poc_java.git'
}
bat 'gradlew.bat bootJar'
bat 'cf8.exe login -u hu-chunqiang@ncontr.com -p hUcq1125 -a https://api.cf.jp10.hana.ondemand.com'
bat 'cf8.exe push'
}
}
}
}