diff options
-rw-r--r-- | 99-gitmirror.sudoers | 1 | ||||
-rw-r--r-- | example-merge-patch.config.xml | 97 | ||||
-rw-r--r-- | example-sync-mirror.config.xml | 38 |
3 files changed, 136 insertions, 0 deletions
diff --git a/99-gitmirror.sudoers b/99-gitmirror.sudoers new file mode 100644 index 0000000..235e27c --- /dev/null +++ b/99-gitmirror.sudoers | |||
@@ -0,0 +1 @@ | |||
jenkins ALL=(gitolite:gitolite) NOPASSWD: /usr/local/bin/gitmirror.sh * | |||
diff --git a/example-merge-patch.config.xml b/example-merge-patch.config.xml new file mode 100644 index 0000000..4dc25ba --- /dev/null +++ b/example-merge-patch.config.xml | |||
@@ -0,0 +1,97 @@ | |||
1 | <?xml version='1.1' encoding='UTF-8'?> | ||
2 | <project> | ||
3 | <actions/> | ||
4 | <description></description> | ||
5 | <keepDependencies>false</keepDependencies> | ||
6 | <properties> | ||
7 | <org.jenkinsci.plugins.authorizeproject.AuthorizeProjectProperty plugin="authorize-project@1.3.0"> | ||
8 | <strategy class="org.jenkinsci.plugins.authorizeproject.strategy.TriggeringUsersAuthorizationStrategy"/> | ||
9 | </org.jenkinsci.plugins.authorizeproject.AuthorizeProjectProperty> | ||
10 | <jenkins.model.BuildDiscarderProperty> | ||
11 | <strategy class="hudson.tasks.LogRotator"> | ||
12 | <daysToKeep>-1</daysToKeep> | ||
13 | <numToKeep>30</numToKeep> | ||
14 | <artifactDaysToKeep>-1</artifactDaysToKeep> | ||
15 | <artifactNumToKeep>-1</artifactNumToKeep> | ||
16 | </strategy> | ||
17 | </jenkins.model.BuildDiscarderProperty> | ||
18 | <hudson.model.ParametersDefinitionProperty> | ||
19 | <parameterDefinitions> | ||
20 | <net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition plugin="git-parameter@0.9.13"> | ||
21 | <name>BRANCH</name> | ||
22 | <description></description> | ||
23 | <uuid>a7f175a1-0e8d-45a2-9efd-e1f0ee0ebb9e</uuid> | ||
24 | <type>PT_BRANCH</type> | ||
25 | <branch></branch> | ||
26 | <tagFilter>*</tagFilter> | ||
27 | <branchFilter>origin/(.*)</branchFilter> | ||
28 | <sortMode>ASCENDING_SMART</sortMode> | ||
29 | <defaultValue>master</defaultValue> | ||
30 | <selectedValue>NONE</selectedValue> | ||
31 | <quickFilterEnabled>false</quickFilterEnabled> | ||
32 | <listSize>5</listSize> | ||
33 | </net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition> | ||
34 | </parameterDefinitions> | ||
35 | </hudson.model.ParametersDefinitionProperty> | ||
36 | </properties> | ||
37 | <scm class="hudson.plugins.git.GitSCM" plugin="git@4.5.2"> | ||
38 | <configVersion>2</configVersion> | ||
39 | <userRemoteConfigs> | ||
40 | <hudson.plugins.git.UserRemoteConfig> | ||
41 | <name>origin</name> | ||
42 | <refspec>+refs/heads/patch-for/${BRANCH}:refs/remotes/origin/patch-for/${BRANCH} +refs/remotes/upstream/${BRANCH}:refs/remotes/origin/upstream/${BRANCH}</refspec> | ||
43 | <url>example.org:example.git</url> | ||
44 | <credentialsId>gitolite-ssh</credentialsId> | ||
45 | </hudson.plugins.git.UserRemoteConfig> | ||
46 | </userRemoteConfigs> | ||
47 | <branches> | ||
48 | <hudson.plugins.git.BranchSpec> | ||
49 | <name>patch-for/${BRANCH}</name> | ||
50 | </hudson.plugins.git.BranchSpec> | ||
51 | </branches> | ||
52 | <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> | ||
53 | <browser class="hudson.plugins.git.browser.CGit"> | ||
54 | <url>https://git.example.org/example</url> | ||
55 | </browser> | ||
56 | <submoduleCfg class="list"/> | ||
57 | <extensions> | ||
58 | <hudson.plugins.git.extensions.impl.CloneOption> | ||
59 | <shallow>false</shallow> | ||
60 | <noTags>true</noTags> | ||
61 | <reference></reference> | ||
62 | <honorRefspec>true</honorRefspec> | ||
63 | </hudson.plugins.git.extensions.impl.CloneOption> | ||
64 | <hudson.plugins.git.extensions.impl.PreBuildMerge> | ||
65 | <options> | ||
66 | <mergeRemote>origin</mergeRemote> | ||
67 | <mergeTarget>upstream/${BRANCH}</mergeTarget> | ||
68 | <mergeStrategy>default</mergeStrategy> | ||
69 | <fastForwardMode>NO_FF</fastForwardMode> | ||
70 | </options> | ||
71 | </hudson.plugins.git.extensions.impl.PreBuildMerge> | ||
72 | </extensions> | ||
73 | </scm> | ||
74 | <canRoam>true</canRoam> | ||
75 | <disabled>false</disabled> | ||
76 | <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | ||
77 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | ||
78 | <triggers/> | ||
79 | <concurrentBuild>false</concurrentBuild> | ||
80 | <builders/> | ||
81 | <publishers> | ||
82 | <hudson.plugins.git.GitPublisher plugin="git@4.5.2"> | ||
83 | <configVersion>2</configVersion> | ||
84 | <pushMerge>false</pushMerge> | ||
85 | <pushOnlyIfSuccess>true</pushOnlyIfSuccess> | ||
86 | <forcePush>true</forcePush> | ||
87 | <branchesToPush> | ||
88 | <hudson.plugins.git.GitPublisher_-BranchToPush> | ||
89 | <targetRepoName>origin</targetRepoName> | ||
90 | <branchName>${BRANCH}</branchName> | ||
91 | <rebaseBeforePush>false</rebaseBeforePush> | ||
92 | </hudson.plugins.git.GitPublisher_-BranchToPush> | ||
93 | </branchesToPush> | ||
94 | </hudson.plugins.git.GitPublisher> | ||
95 | </publishers> | ||
96 | <buildWrappers/> | ||
97 | </project> | ||
diff --git a/example-sync-mirror.config.xml b/example-sync-mirror.config.xml new file mode 100644 index 0000000..b4064b3 --- /dev/null +++ b/example-sync-mirror.config.xml | |||
@@ -0,0 +1,38 @@ | |||
1 | <?xml version='1.1' encoding='UTF-8'?> | ||
2 | <project> | ||
3 | <actions/> | ||
4 | <description></description> | ||
5 | <keepDependencies>false</keepDependencies> | ||
6 | <properties> | ||
7 | <org.jenkinsci.plugins.authorizeproject.AuthorizeProjectProperty plugin="authorize-project@1.3.0"> | ||
8 | <strategy class="org.jenkinsci.plugins.authorizeproject.strategy.AnonymousAuthorizationStrategy"/> | ||
9 | </org.jenkinsci.plugins.authorizeproject.AuthorizeProjectProperty> | ||
10 | <jenkins.model.BuildDiscarderProperty> | ||
11 | <strategy class="hudson.tasks.LogRotator"> | ||
12 | <daysToKeep>14</daysToKeep> | ||
13 | <numToKeep>-1</numToKeep> | ||
14 | <artifactDaysToKeep>-1</artifactDaysToKeep> | ||
15 | <artifactNumToKeep>-1</artifactNumToKeep> | ||
16 | </strategy> | ||
17 | </jenkins.model.BuildDiscarderProperty> | ||
18 | </properties> | ||
19 | <scm class="hudson.scm.NullSCM"/> | ||
20 | <canRoam>true</canRoam> | ||
21 | <disabled>false</disabled> | ||
22 | <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | ||
23 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | ||
24 | <triggers> | ||
25 | <hudson.triggers.TimerTrigger> | ||
26 | <spec>H 7 * * *</spec> | ||
27 | </hudson.triggers.TimerTrigger> | ||
28 | </triggers> | ||
29 | <concurrentBuild>false</concurrentBuild> | ||
30 | <builders> | ||
31 | <hudson.tasks.Shell> | ||
32 | <command>sudo -u gitolite -g gitolite /usr/local/bin/gitmirror.sh example</command> | ||
33 | <configuredLocalRules/> | ||
34 | </hudson.tasks.Shell> | ||
35 | </builders> | ||
36 | <publishers/> | ||
37 | <buildWrappers/> | ||
38 | </project> | ||