Skip to content

Commit bee7e82

Browse files
committed
Add Update ChocolateyCore Repository Jenkins Job
Add new Jenkins Job Add test to check for new Jenkins job Signed-off-by: Ryan Richter <[email protected]>
1 parent d2de05b commit bee7e82

File tree

6 files changed

+50
-14
lines changed

6 files changed

+50
-14
lines changed

jenkins/Update ChocolateyCore Repository/builds/legacyIds

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lastFailedBuild -1
2+
lastSuccessfulBuild -1
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.1" encoding="UTF-8"?><flow-definition plugin="[email protected]">
2+
<actions/>
3+
<description>Automatically update any out of date packages in the ChocolateyCore repository from the Licensed and Community Repositories</description>
4+
<keepDependencies>false</keepDependencies>
5+
<properties>
6+
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
7+
<hudson.model.ParametersDefinitionProperty>
8+
<parameterDefinitions>
9+
<hudson.model.StringParameterDefinition>
10+
<name>P_LOCAL_REPO_URL</name>
11+
<description>Internal core repository.</description>
12+
<defaultValue>https://{{hostname}}:8443/repository/ChocolateyCore/index.json</defaultValue>
13+
<trim>true</trim>
14+
</hudson.model.StringParameterDefinition>
15+
<hudson.model.StringParameterDefinition>
16+
<name>P_REMOTE_REPO_URL</name>
17+
<description>Remote repositories containing updated package versions.</description>
18+
<defaultValue>https://licensedpackages.chocolatey.org/api/v2/;https://community.chocolatey.org/api/v2/</defaultValue>
19+
<trim>true</trim>
20+
</hudson.model.StringParameterDefinition>
21+
<hudson.model.PasswordParameterDefinition>
22+
<name>P_LOCAL_REPO_API_KEY</name>
23+
<description>API key for the internal core repository where updated packages will be pushed.</description>
24+
<defaultValue>{{NugetApiKey}}</defaultValue>
25+
</hudson.model.PasswordParameterDefinition>
26+
</parameterDefinitions>
27+
</hudson.model.ParametersDefinitionProperty>
28+
</properties>
29+
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
30+
<script>node {
31+
powershell '''
32+
Set-Location (Join-Path "$env:SystemDrive" -ChildPath 'scripts')
33+
.\\Get-UpdatedPackage.ps1 -LocalRepo $env:P_LOCAL_REPO_URL `
34+
-LocalRepoApiKey $env:P_LOCAL_REPO_API_KEY `
35+
-RemoteRepo $env:P_REMOTE_REPO_URL `
36+
-Verbose
37+
'''
38+
}</script>
39+
<sandbox>true</sandbox>
40+
</definition>
41+
<triggers/>
42+
<disabled>false</disabled>
43+
</flow-definition>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

jenkins/Update production repository/config.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@
2525
</hudson.model.StringParameterDefinition>
2626
</parameterDefinitions>
2727
</hudson.model.ParametersDefinitionProperty>
28-
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
29-
<triggers>
30-
<jenkins.triggers.ReverseBuildTrigger>
31-
<spec/>
32-
<upstreamProjects>Internalize packages from the Community Repository, Update test repository from Chocolatey Community Repository, </upstreamProjects>
33-
<threshold>
34-
<name>SUCCESS</name>
35-
<ordinal>0</ordinal>
36-
<color>BLUE</color>
37-
<completeBuild>true</completeBuild>
38-
</threshold>
39-
</jenkins.triggers.ReverseBuildTrigger>
40-
</triggers>
41-
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
4228
</properties>
4329
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
4430
<script> node {

tests/jenkins.test.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Describe "Jenkins Configuration" {
6464
It "'Update test repository from Chocolatey Community Repository' is present" {
6565
'Update test repository from Chocolatey Community Repository' -in $jobs | Should -Be $true
6666
}
67+
68+
It "'Update ChocolateyCore Repository' is present" {
69+
'Update ChocolateyCore Repository' -in $jobs | Should -Be $true
70+
}
6771
}
6872

6973
Context "Web Interface" {

0 commit comments

Comments
 (0)