Skip to content

Commit

Permalink
(#230) Add ChocolateyCore Repository Jenkins Job
Browse files Browse the repository at this point in the history
Add new Update ChocolateyCore Repository Jenkins Job
Add test to check for new Jenkins job

Signed-off-by: Ryan Richter <[email protected]>
  • Loading branch information
ryanrichter94 committed Jul 29, 2024
1 parent 6070d37 commit 42173a7
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 14 deletions.
Empty file.
2 changes: 2 additions & 0 deletions jenkins/Update ChocolateyCore Repository/builds/permalinks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lastFailedBuild -1
lastSuccessfulBuild -1
43 changes: 43 additions & 0 deletions jenkins/Update ChocolateyCore Repository/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.1" encoding="UTF-8"?><flow-definition plugin="[email protected]">
<actions/>
<description>Automatically update any out of date packages in the ChocolateyCore repository from the Licensed and Community Repositories</description>
<keepDependencies>false</keepDependencies>
<properties>
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>P_LOCAL_REPO_URL</name>
<description>Internal core repository.</description>
<defaultValue>https://{{hostname}}:8443/repository/ChocolateyCore/index.json</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>P_REMOTE_REPO_URL</name>
<description>Remote repositories containing updated package versions.</description>
<defaultValue>https://licensedpackages.chocolatey.org/api/v2/;https://community.chocolatey.org/api/v2/</defaultValue>
<trim>true</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.PasswordParameterDefinition>
<name>P_LOCAL_REPO_API_KEY</name>
<description>API key for the internal core repository where updated packages will be pushed.</description>
<defaultValue>{{NugetApiKey}}</defaultValue>
</hudson.model.PasswordParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
<script>node {
powershell '''
Set-Location (Join-Path "$env:SystemDrive" -ChildPath 'scripts')
.\\Get-UpdatedPackage.ps1 -LocalRepo $env:P_LOCAL_REPO_URL `
-LocalRepoApiKey $env:P_LOCAL_REPO_API_KEY `
-RemoteRepo $env:P_REMOTE_REPO_URL `
-Verbose
'''
}</script>
<sandbox>true</sandbox>
</definition>
<triggers/>
<disabled>false</disabled>
</flow-definition>
1 change: 1 addition & 0 deletions jenkins/Update ChocolateyCore Repository/nextBuildNumber
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
14 changes: 0 additions & 14 deletions jenkins/Update production repository/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
<triggers>
<jenkins.triggers.ReverseBuildTrigger>
<spec/>
<upstreamProjects>Internalize packages from the Community Repository, Update test repository from Chocolatey Community Repository, </upstreamProjects>
<threshold>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>BLUE</color>
<completeBuild>true</completeBuild>
</threshold>
</jenkins.triggers.ReverseBuildTrigger>
</triggers>
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]">
<script> node {
Expand Down
4 changes: 4 additions & 0 deletions tests/jenkins.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Describe "Jenkins Configuration" {
It "'Update test repository from Chocolatey Community Repository' is present" {
'Update test repository from Chocolatey Community Repository' -in $jobs | Should -Be $true
}

It "'Update ChocolateyCore Repository' is present" {
'Update ChocolateyCore Repository' -in $jobs | Should -Be $true
}
}

Context "Web Interface" {
Expand Down

0 comments on commit 42173a7

Please sign in to comment.