-
Notifications
You must be signed in to change notification settings - Fork 15
jenkins_restapi
choisungwook edited this page May 28, 2021
·
6 revisions
reference: https://stackoverflow.com/questions/50408059/create-folder-in-jenkins-ui-using-curl/50413959
- 아래 예제는 https://choilab.com/jenkins1도메인에서 test1폴더를 생성
curl -XPOST -k \
'https://choilab.com/jenkins1/createItem?name=test1&mode=com.cloudbees.hudson.plugins.folder.Folder&from=&json={"name":"test1","mode":"com.cloudbees.hudson.plugins.folder.Folder","from":"","Submit":"OK"}&Submit=OK' \
--user admin:1192f220a80306dbe4a07fe4d9d133dc2f \
-H "Content-Type:application/x-www-form-urlencoded"
- 을 잡이름으로 수정
curl -k -XPOST \
'http://choilab.com/jenkins1/job/<foldername>/createItem?name=<jobname>' \
--data-binary @config.xml \
-H "Content-Type:text/xml" \
--user admin:<access token>
- config.xml은 url, name
<?xml version='1.1' encoding='UTF-8'?>
<flow-definition plugin="[email protected]">
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]">
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/choisungwookDevops/jenkins-podtemplate-springboot.git</url> <!-- git repo url -->
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/main</name> <!-- 브랜치 -->
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="empty-list"/>
<extensions/>
</scm>
<scriptPath>Jenkinsfile</scriptPath> <!-- jenkinsfile 이름 -->
<lightweight>true</lightweight>
</definition>
<triggers/>
<disabled>false</disabled>
</flow-definition>
쿠버네티스
- helm차트
- 템플릿
- argocd
- cert-manager
- nexus
- 기타
리눅스
개발
기타
-
vagrant
-
jenkins
-
ansible
-
gitlab
-
redis
-
기타