jenkins

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean()

Remove the build directory used by jenkins targets

func InstallPlugins

func InstallPlugins()

Ensure required plugins are installed on the Jenkins master.

We rely on a number of plugins to be present on the Jenkins master, and this target ensures they are present.

To add/remove a plugin from the list of managed plugins, update the basePlugins list in mage/jenkins/lib.go. Note that not every plugin on the Jenkins server is managed in this list, many came pre-installed and aren't managed by this target. It's always reasonable to start managing a plugin that is on the Jenkins master via the target, even if it was installed some other way.

This target uses the Jenkins API and MJ_USER and MJ_TOKEN must be set.

func Restart

func Restart()

Perform a 'safe restart' of the master jenkins server.

It's sometimes necessary to restart the Jenkins master after performing maintenance, this target helps to do so. If this is necessary, the Jenkins UI will notify you.

This target uses the Jenkins API and MJ_USER and MJ_TOKEN must be set.

func UpdateAll

func UpdateAll()

Perform all automated maintenance on the Jenkins Master.

Installs plugins, Updates plugins, Updates the JCasC config, Updates job configs, and updates the system packages. Does not automatically restart the Jenkins Master as this is often unnecessary and can be disruptive.

func UpdateConfigFiles

func UpdateConfigFiles()

Deploy config files to the Jenkins master over scp.

Some parameters can only be specified via configuration files on the Jenkins master, not via APIs. This target deploys those files to the Jenkins master after backing them up locally.

func UpdateJcasc

func UpdateJcasc()

Update the Jenkins Config as Code config on the Jenkins Master.

We use Jenkins Config as Code to manage the configuration of the Jenkins master from source control. This target updates the configuration of the Jenkins master based on the contents of masterConfig.yaml.

Note that not all config is managed this way. In particular, secrets are deliberately omitted from masterConfig.yaml so they don't get checked into source code. It's assumed that the necessary secrets have been manually added to the master prior to running this target. Job definitions are also not currently present in the JCasC yaml, but may be in the future.

When configuring a new plugin or feature, it's not necessary to know the necessary yaml structure. It is possible to edit the config via the Jenkins UI, and then examine the exported JCasC at: https://jenkins-container-tooling.build.dsinternal.org/configuration-as-code/ It's common to extract config snippets this way to check into source control.

This target uses the Jenkins API and MJ_USER and MJ_TOKEN must be set.

func UpdateJobs

func UpdateJobs()

Update job configurations on the Jenkins master.

All .groovy files in the jenkins/master/jobs directory will be processed and posted to the master server through the JCasC endpoint.

The Job-dsl plugin allows JCasC to accept job configurations. The groovy syntax used to define these configurations is documented at: https://jenkins-container-tooling.build.dsinternal.org/plugin/job-dsl/api-viewer/index.html

func UpdatePlugins

func UpdatePlugins()

Update all plugins on the Jenkins master.

We rely on a number of plugins to be present on the Jenkins master, and this target ensures they are updated to the most recent release. This updates ALL plugins on the Jenkins master, not only those managed by the InstallPlugins target.

This target uses the Jenkins API and MJ_USER and MJ_TOKEN must be set.

func UpdateSystem

func UpdateSystem()

Update OS packages on the Jenkins master, including the Jenkins package.

This SSH's into the Jenkins master to perform an apt upgrade. It assumes that you have passwordless SSH login to the Jenkins master configured, and that your remote account on the Jenkins master has passwordless sudo.

By default, the "ubuntu" user is used to log in. This can be customized via the MJ_SSHUSER environment variable.

func UpdateViews

func UpdateViews()

Update job views on the Jenkins master.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL