Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins version 2.440.3 #148

Merged
merged 4 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jenkins_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ parts:
- default-jre-headless
- git
build-environment:
- JENKINS_VERSION: 2.440.2
- JENKINS_VERSION: 2.440.3
- JENKINS_PLUGIN_MANAGER_VERSION: 2.12.13
override-build: |
mkdir -p ${CRAFT_PART_INSTALL}/{srv/jenkins/,etc/default/jenkins/}
Expand Down
2 changes: 1 addition & 1 deletion src-docs/agent.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Shortcut for more simple access the model.

---

<a href="../src/agent.py#L247"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/agent.py#L248"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `reconfigure_agent_discovery`

Expand Down
2 changes: 1 addition & 1 deletion src-docs/auth_proxy.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Observer module for Jenkins to auth_proxy integration.
## <kbd>class</kbd> `Observer`
The Jenkins Auth Proxy integration observer.

<a href="../src/auth_proxy.py#L27"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/auth_proxy.py#L31"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down
48 changes: 33 additions & 15 deletions src-docs/jenkins.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Functions to operate Jenkins.

---

<a href="../src/jenkins.py#L114"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_admin_credentials`

Expand All @@ -54,7 +54,7 @@ Retrieve admin credentials.

---

<a href="../src/jenkins.py#L651"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L691"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `is_storage_ready`

Expand Down Expand Up @@ -84,7 +84,7 @@ Return whether the Jenkins home directory is mounted and owned by jenkins.

---

<a href="../src/jenkins.py#L706"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L746"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `install_default_config`

Expand All @@ -103,7 +103,7 @@ Install default jenkins-config.xml.

---

<a href="../src/jenkins.py#L715"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L755"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `install_auth_proxy_config`

Expand All @@ -122,7 +122,7 @@ Install jenkins-config.xml for auth_proxy.

---

<a href="../src/jenkins.py#L818"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L858"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_agent_name`

Expand Down Expand Up @@ -183,7 +183,7 @@ Wrapper for Jenkins functionality.

Attrs: environment: the Jenkins environment configuration. web_url: the Jenkins web URL. login_url: the Jenkins login URL. version: the Jenkins version.

<a href="../src/jenkins.py#L160"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L163"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -237,7 +237,7 @@ Returns: the web URL.

---

<a href="../src/jenkins.py#L396"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L436"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `add_agent_node`

Expand All @@ -262,7 +262,7 @@ Add a Jenkins agent node.

---

<a href="../src/jenkins.py#L313"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L353"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `bootstrap`

Expand Down Expand Up @@ -292,7 +292,7 @@ Initialize and install Jenkins.

---

<a href="../src/jenkins.py#L338"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L378"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `get_node_secret`

Expand Down Expand Up @@ -322,7 +322,7 @@ Get node secret from jenkins.

---

<a href="../src/jenkins.py#L416"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L456"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `remove_agent_node`

Expand All @@ -347,7 +347,7 @@ Remove a Jenkins agent node.

---

<a href="../src/jenkins.py#L546"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L586"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `remove_unlisted_plugins`

Expand Down Expand Up @@ -377,7 +377,7 @@ Remove plugins that are not in the list of desired plugins.

---

<a href="../src/jenkins.py#L518"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L558"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `rotate_credentials`

Expand Down Expand Up @@ -406,7 +406,7 @@ Invalidate all Jenkins sessions and create new password for admin account.

---

<a href="../src/jenkins.py#L464"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L504"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `safe_restart`

Expand All @@ -430,7 +430,25 @@ Safely restart Jenkins server after all jobs are done executing.

---

<a href="../src/jenkins.py#L212"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L204"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `update_prefix`

```python
update_prefix(prefix: str) → None
```

Update jenkins prefix.



**Args:**

- <b>`prefix`</b>: the new prefix.

---

<a href="../src/jenkins.py#L223"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `wait_ready`

Expand Down Expand Up @@ -492,7 +510,7 @@ Represents an error probing for Jenkins storage mount.

- <b>`msg`</b>: Explanation of the error.

<a href="../src/jenkins.py#L642"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L682"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down
4 changes: 3 additions & 1 deletion src-docs/pebble.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Pebble functionality.
replan_jenkins(
container: Container,
jenkins_instance: Jenkins,
state: State
state: State,
disable_security: bool = False
) → None
```

Expand All @@ -32,6 +33,7 @@ Replan the jenkins services.
- <b>`container`</b>: the container for with to replan the services.
- <b>`jenkins_instance`</b>: the Jenkins instance.
- <b>`state`</b>: the charm state.
- <b>`disable_security`</b>: whether to replan with security disabled.



Expand Down
47 changes: 31 additions & 16 deletions tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,30 +330,45 @@ async def test_thinbackup_plugin(ops_test: OpsTest, unit_web_client: UnitWebClie
"""
await install_plugins(unit_web_client, ("thinBackup",))
backup_path = "/srv/jenkins/backup/"
res = unit_web_client.client.requester.post_url(
f"{unit_web_client.web}/manage/thinBackup/saveSettings",
data={
payload = {
"jenkins-model-MasterBuildConfiguration": {
"numExecutors": "0",
},
"jenkins-model-GlobalQuietPeriodConfiguration": {"quietPeriod": "5"},
"jenkins-model-GlobalSCMRetryCountConfiguration": {"scmCheckoutRetryCount": "0"},
"org-jvnet-hudson-plugins-thinbackup-ThinBackupPluginImpl": {
"backupPath": backup_path,
"fullBackupSchedule": "",
"diffBackupSchedule": "",
"nrMaxStoredFull": -1,
"excludedFilesRegex": "",
"forceQuietModeTimeout": 120,
"failFast": "on",
"Submit": "",
},
}
res = unit_web_client.client.requester.post_url(
f"{unit_web_client.web}/configSubmit",
data=[
(
"json",
json.dumps(payload),
),
],
)
res.raise_for_status()
res = unit_web_client.client.requester.get_url(
res = unit_web_client.client.requester.post_url(
f"{unit_web_client.web}/manage/thinBackup/backupManual"
)
res.raise_for_status()

ret, stdout, stderr = await ops_test.juju(
"ssh", "--container", "jenkins", unit_web_client.unit.name, "ls", backup_path
)
assert ret == 0, f"Failed to ls backup path, {stderr}"
assert "FULL" in stdout, "The backup folder of format FULL-<backup-date> not found."
async def has_backup():
"""Get whether the backup is created.

The backup folder of format FULL-<backup-date> should be created.
"""
ret, stdout, stderr = await ops_test.juju(
"ssh", "--container", "jenkins", unit_web_client.unit.name, "ls", backup_path
)
logger.info(
"Run backup path ls result: code: %s stdout: %s, stderr: %s", ret, stdout, stderr
)
return ret == 0 and "FULL" in stdout

await wait_for(has_backup)


async def test_bzr_plugin(unit_web_client: UnitWebClient):
Expand Down
Loading