-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5d3aa1
commit 31e02bc
Showing
6 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/jenkins.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Jenkins tools is intended to help with mass operations on ci.opensuse.org. | ||
Tool can be used only if you have account with proper rights. | ||
It is not intended to be distributed in rpm | ||
Usage require reading source code of each tool where is part of configuration | ||
and exaplained how it works (if you can make your quicklier then reading script, | ||
then it is not right tool for you) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project> | ||
<actions/> | ||
<description></description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties/> | ||
<scm class="hudson.plugins.git.GitSCM" plugin="git@1.5.0"> | ||
<configVersion>2</configVersion> | ||
<userRemoteConfigs> | ||
<hudson.plugins.git.UserRemoteConfig> | ||
<name></name> | ||
<refspec></refspec> | ||
<url>https://github.com/yast/yast-core.git</url> | ||
</hudson.plugins.git.UserRemoteConfig> | ||
</userRemoteConfigs> | ||
<branches> | ||
<hudson.plugins.git.BranchSpec> | ||
<name>master</name> | ||
</hudson.plugins.git.BranchSpec> | ||
</branches> | ||
<disableSubmodules>false</disableSubmodules> | ||
<recursiveSubmodules>false</recursiveSubmodules> | ||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> | ||
<authorOrCommitter>false</authorOrCommitter> | ||
<clean>false</clean> | ||
<wipeOutWorkspace>false</wipeOutWorkspace> | ||
<pruneBranches>false</pruneBranches> | ||
<remotePoll>false</remotePoll> | ||
<ignoreNotifyCommit>false</ignoreNotifyCommit> | ||
<useShallowClone>false</useShallowClone> | ||
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/> | ||
<gitTool>Default</gitTool> | ||
<submoduleCfg class="list"/> | ||
<relativeTargetDir></relativeTargetDir> | ||
<reference></reference> | ||
<excludedRegions></excludedRegions> | ||
<excludedUsers></excludedUsers> | ||
<gitConfigName></gitConfigName> | ||
<gitConfigEmail></gitConfigEmail> | ||
<skipTag>false</skipTag> | ||
<includedRegions></includedRegions> | ||
<scmName></scmName> | ||
</scm> | ||
<assignedNode>yast-jenkins</assignedNode> | ||
<canRoam>false</canRoam> | ||
<disabled>false</disabled> | ||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | ||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | ||
<triggers> | ||
<hudson.triggers.SCMTrigger> | ||
<spec>H/5 * * * *</spec> | ||
<ignorePostCommitHooks>false</ignorePostCommitHooks> | ||
</hudson.triggers.SCMTrigger> | ||
</triggers> | ||
<concurrentBuild>false</concurrentBuild> | ||
<builders> | ||
<hudson.tasks.Shell> | ||
<command> | ||
cd $WORKSPACE; rake osc:commit; cd - | ||
</command> | ||
</hudson.tasks.Shell> | ||
</builders> | ||
<publishers/> | ||
<buildWrappers/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user: | ||
pwd: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require "fileutils" | ||
require "yaml" | ||
|
||
# script for mass create of jobs in our jenkins | ||
# credentials stored in jenkins.yml | ||
# modify `config.xml` if needed ( git path will be automatic modify ) | ||
# modify JOB_NAME_PATTERN before use to specify pattern of job to delete | ||
|
||
conf = YAML.load(File.read("jenkins.yml")) | ||
USER = conf["user"] | ||
PWD = conf["pwd"] | ||
|
||
# %s is replaced by arguments passed to program | ||
JOB_NAME_PATTERN = "yast-%s-master" | ||
|
||
ARGV.each do |mod| | ||
#test if module already exist | ||
response_code = `curl -sL -w "%{http_code}" https://#{USER}:#{PWD}@ci.opensuse.org/view/Yast/job/yast-#{mod}-master/ -o /dev/null` | ||
next if response_code == "200" | ||
|
||
FileUtils.rm_f "config.xml.tmp" | ||
# now modify config.xml to fit given module | ||
`sed 's/yast-.*\.git/yast-#{mod}.git/' config.xml > config.xml.tmp` | ||
|
||
# adress found from https://ci.opensuse.org/api | ||
res = `curl -X POST https://#{USER}:#{PWD}@ci.opensuse.org/createItem?name=#{JOB_NAME_PATTERN % mod} --header "Content-Type:application/xml" -d @config.xml.tmp` | ||
puts "ERROR: #{res}" if $?.exitstatus != 0 | ||
puts "ERROR: Wrong Credentials. \n #{res}" if res =~ /Authentication required/ | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# script for mass delete of jobs in our jenkins | ||
# credentials stored in jenkins.yml | ||
# modify JOB_NAME_PATTERN before use to specify pattern of job to delete | ||
|
||
require "yaml" | ||
|
||
conf = YAML.load(File.read("jenkins.yml")) | ||
USER = conf["user"] | ||
PWD = conf["pwd"] | ||
# %s is replaced by arguments passed to program | ||
JOB_NAME_PATTERN = "yast-%s-test" | ||
|
||
ARGV.each do |mod| | ||
# address to delete from http://jenkins-ci.361315.n4.nabble.com/Deleting-a-job-through-the-Remote-API-td3622851.html | ||
`curl -X POST https://#{USER}:#{PWD}@ci.opensuse.org/job/#{JOB_NAME_PATTERN % mod}/doDelete` | ||
end |