Downloads:
6
Downloads of v 1.0.0:
6
Last Update:
24 Apr 2024
Published Date:
24 Apr 2024
Package Maintainer(s):
Software Author(s):
- jpruskin
Tags:
jenkins hook- Software Specific:
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Set Jenkins Prefix (Hook)
(Waiting for Maintainer to take corrective action)
- 1
- 2
- 3
1.0.0 | Updated: 24 Apr 2024
- Software Specific:
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
6
Downloads of v 1.0.0:
6
Published:
24 Apr 2024
Maintainer(s):
Software Author(s):
- jpruskin
Set Jenkins Prefix (Hook) 1.0.0
(Waiting for Maintainer to take corrective action)
- 1
- 2
- 3
Some Checks Have Failed or Are Not Yet Complete
Not All Tests Have Passed
Validation Testing Failed
Verification Testing Pending
Scan Testing Pending
This version is in moderation and has not yet been approved. This means it doesn't show up under normal search.
- Until approved, you should consider this package version unsafe - it could do very bad things to your system (it probably doesn't but you have been warned, that's why we have moderation).
- This package version can change wildly over the course of moderation until it is approved. If you install it and it later has changes to this version, you will be out of sync with any changes that have been made to the package. Until approved, you should consider that this package version doesn't even exist.
- You cannot install this package under normal scenarios. See How to install package version under moderation for more information.
- There are also no guarantees that it will be approved.
There are versions of this package awaiting moderation (possibly just this one). See the Version History section below.
Due to the way Jenkins' MSI installs, changes to the Jenkins.xml configuration file can be unset (though backed up).
This hook sets the Prefix value after every installation of Jenkins, ensuring that paths won't break unexpectedly.
Package Parameters
/Prefix
- Sets the value of the prefix to use. Defaults tojenkins
./InstallOnly
- Skips adding the prefix during installation. Will be added on next hook-run.
These parameters can be passed as follows:
choco install jenkins-set-prefix.hook --parameters="/Prefix=ci"
$HookDir = Split-Path $MyInvocation.MyCommand.Definition -Parent
Import-Module $HookDir\functions.psm1
$Prefix = Get-PrefixValue
# Get the path to the XML config file
$XmlPath = Join-Path (Get-JenkinsInstallPath) "Jenkins.xml"
# If it's missing or different, add the prefix to the config arguments
if (Test-Path $XmlPath) {
[xml]$JenkinsXml = Get-Content $XmlPath
if ($JenkinsXml.SelectSingleNode("/service/arguments")."#text" -notmatch "--prefix=/$Prefix") {
$JenkinsXml.SelectSingleNode("/service/arguments")."#text" = $JenkinsXml.SelectSingleNode("/service/arguments")."#text" -replace "\s*--prefix=/.+?\b", ""
$JenkinsXml.SelectSingleNode("/service/arguments")."#text" += " --prefix=/$Prefix"
$JenkinsXml.Save($XmlPath)
}
} else {
Write-Error "Could not find '$XmlPath'"
}
Restart-Service Jenkins
function GetPrefixValuePath {
[CmdletBinding()]
param()
$thisDir = Split-Path $PSCmdlet.MyInvocation.PSCommandPath -Parent
Join-Path (Convert-Path $thisDir\..\hook) "prefixvalue.txt"
}
function Get-PrefixValue {
if (Test-Path (GetPrefixValuePath)) {
Get-Content -Path (GetPrefixValuePath)
}
}
function Set-PrefixValue {
param($Value)
Set-Content -Path (GetPrefixValuePath) -Value $Value
}
function Get-JenkinsInstallPath {
$RegistryPath = "HKLM:\SOFTWARE\Jenkins\InstalledProducts\Jenkins"
if (Test-Path $RegistryPath) {
Get-ItemPropertyValue -Path $RegistryPath -Name "InstallLocation"
} else {
Write-Warning "Jenkins registry keys at '$($RegistryPath)' could not be found."
"C:\Program Files\Jenkins\"
}
}
No results available for this package. We are building up results for older packages over time so expect to see results. If this is a new package, it should have results within a day or two.
© 2023 James Ruskin
-
- chocolatey (≥ 1.2.0)
Ground Rules:
- This discussion is only about Set Jenkins Prefix (Hook) and the Set Jenkins Prefix (Hook) package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or Set Jenkins Prefix (Hook), or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
jpruskin (maintainer) on 24 Apr 2024 09:44:45 +00:00:
User 'jpruskin' (maintainer) submitted package.
chocolatey-ops (reviewer) on 24 Apr 2024 10:18:44 +00:00:
jenkins-set-prefix.hook has failed automated validation.
Requirements
Requirements represent the minimum quality of a package that is acceptable. When a package version has failed requirements, the package version requires fixing and/or response by the maintainer. Provided a Requirement has flagged correctly, it must be fixed before the package version can be approved. The exact same version should be uploaded during moderation review.
Guidelines
Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.
Notes
Notes typically flag things for both you and the reviewer to go over. Sometimes this is the use of things that may or may not be necessary given the constraints of what you are trying to do and/or are harder for automation to flag for other reasons. Items found in Notes might be Requirements depending on the context. A package version can be approved without addressing Note comments.
jpruskin (maintainer) on 24 Apr 2024 11:03:45 +00:00:
User 'jpruskin' (maintainer) submitted package.
chocolatey-ops (reviewer) on 24 Apr 2024 11:38:50 +00:00:
jenkins-set-prefix.hook has failed automated validation.
Requirements
Requirements represent the minimum quality of a package that is acceptable. When a package version has failed requirements, the package version requires fixing and/or response by the maintainer. Provided a Requirement has flagged correctly, it must be fixed before the package version can be approved. The exact same version should be uploaded during moderation review.
Guidelines
Guidelines are strong suggestions that improve the quality of a package version. These are considered something to fix for next time to increase the quality of the package. Over time Guidelines can become Requirements. A package version can be approved without addressing Guideline comments but will reduce the quality of the package.
Notes
Notes typically flag things for both you and the reviewer to go over. Sometimes this is the use of things that may or may not be necessary given the constraints of what you are trying to do and/or are harder for automation to flag for other reasons. Items found in Notes might be Requirements depending on the context. A package version can be approved without addressing Note comments.