< Back

Initialize-JenkinsUpdateCache

Wed Jan 15, 2020 10:34 am

NAME Initialize-JenkinsUpdateCache



SYNOPSIS

This function creates or updates a local Jenkins Update cache.





SYNTAX

Initialize-JenkinsUpdateCache [[-Uri] <String>] [-Path] <String> [-CacheUri] <String> [[-Include] <String[]>]

[[-Exclude] <String[]>] [-UpdateCore] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The purpose of this function is to make a local copy of the standard Jenkins plugins found on Update-Center. It

can also cache the Jenkins WAR file.



This can allow an administrator to centrally control the plugins that are available to local Jenkins Masters. It

can also control the Jenkins WAR file version that is available.



It also allows creating a Jenkins Plugin cache inside DMZ or restrictive proxy to allow plugins to be made

available to internal Jenkins servers.





PARAMETERS

-Uri <String>

Contains the Uri to the Jenkins Update Center JSON file.



This defaults to http://updates.jenkins-ci.org/update-center.json and should usually not need to be changed.



Required? false

Position? 2

Default value Http://updates.jenkins-ci.org/update-center.json

Accept pipeline input? False

Accept wildcard characters? false



-Path <String>

The path to the folder that the Jenkins Update Cache will be stored in.



Required? true

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CacheUri <String>

Contains the Uri that the local Jenkins Update Cache will be accesible on.



Required? true

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Include <String[]>

The optional list of plugins to include in the cache. Wildcards supported. If neither Include or Exclude are

specified then no plugins will be cached. This allows just caching of the Jenkins core file.



Required? false

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Exclude <String[]>

{{Fill Exclude Description}}



Required? false

Position? 6

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-UpdateCore [<SwitchParameter>]

Setting this switch will cause the Jenkins WAR core to be cached. If this switch is not specified and this is

a new cache then the core will still be available, but it will point to the external URI to download the core.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

{{Fill Force Description}}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

A list of plugin files that were downloaded to the Plugin cache.







NOTES









-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Initialize-JenkinsUpdateCache `

-Path d:\\JenkinsCache \\`

-CacheUri 'http:\\\\\\\\jenkinscache.contoso.com\\cache'

-Include '*' \\`

-UpdateCore



Add or update all plugins and the Jenkins Core in the Jenkins Cache folder in d:\\JenkinsCache.

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Initialize-JenkinsUpdateCache `

-Path d:\\JenkinsCache \\`

-CacheUri 'http:\\\\\\\\jenkinscache.contoso.com\\cache'

-Include 'Yammer'



Add or update the Yammer plugin in the Jenkins Cache folder in d:\\JenkinsCache.

-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Initialize-JenkinsUpdateCache `

-Path d:\\JenkinsCache \\`

-CacheUri 'http:\\\\\\\\jenkinscache.contoso.com\\cache'

-Include 'A*' \\`

-UpdateCore



Add or update all plugins in the Jenkins Cache folder in d:\\JenkinsCache. Also, update the Jenkins Core WAR file

if required.



RELATED LINKS