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

chore: update java version #198

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
730d930
debug
yanksyoon Nov 13, 2024
75bb8a3
debug (typo)
yanksyoon Nov 13, 2024
bc9856e
fix: rockcraft version
yanksyoon Nov 13, 2024
e177c03
update identity bundle versions
yanksyoon Nov 17, 2024
ddbc2d6
trivy ignore unpatched vuln
yanksyoon Nov 17, 2024
90c6ed4
test: use juju 3.5
yanksyoon Nov 19, 2024
23f1434
build command and fix comments
yanksyoon Nov 19, 2024
defafbb
try manual deploy
yanksyoon Nov 19, 2024
8a58d02
test: public ingress relation jenkins
yanksyoon Nov 20, 2024
2e026a5
fix: typo & lint
yanksyoon Nov 20, 2024
a78dd2c
test: add oathkeeper relations
yanksyoon Nov 20, 2024
0ef28f5
test: remove wait for idle before deploy
yanksyoon Nov 20, 2024
ef30be1
test: fix: oathkeeper relation fix
yanksyoon Nov 20, 2024
933646d
test: traefik certificates
yanksyoon Nov 20, 2024
b8c5f9d
test: use model.integrate instead of deprecated model.relatet
yanksyoon Nov 21, 2024
6a7278d
test: model wait for idle to get around buggy charms
yanksyoon Nov 21, 2024
478f67d
await status code
yanksyoon Nov 21, 2024
a69db87
fix tests for auth proxy
yanksyoon Nov 21, 2024
34dc071
fix lint
yanksyoon Nov 21, 2024
8af5df9
fix lint
yanksyoon Nov 21, 2024
452410e
proper auth address
yanksyoon Nov 21, 2024
fc9e56a
fix: auth proxy test
yanksyoon Nov 21, 2024
1d84578
test: fix thinbackup plugin request
yanksyoon Nov 28, 2024
49e2a2e
remove debug
yanksyoon Nov 29, 2024
2ce7c1a
fix type hint
yanksyoon Nov 29, 2024
684bafe
split plugins test
yanksyoon Nov 29, 2024
41c39e6
try 1.29 microk8s
yanksyoon Dec 1, 2024
f4759cb
debug
yanksyoon Dec 1, 2024
7d6f083
kubeconfig dir & debug log
yanksyoon Dec 1, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ jobs:
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
secrets: inherit
with:
channel: 1.28-strict/stable
channel: 1.29-strict/stable
extra-arguments: |
--kube-config=${GITHUB_WORKSPACE}/kube-config
modules: '["test_auth_proxy.py", "test_cos.py", "test_ingress.py", "test_jenkins.py", "test_k8s_agent.py", "test_machine_agent.py", "test_plugins.py", "test_proxy.py", "test_upgrade.py", "test_external_agent.py"]'
modules: '["test_auth_proxy.py", "test_cos.py", "test_ingress.py", "test_jenkins.py", "test_k8s_agent.py", "test_machine_agent.py", "test_plugins_part_1.py", "test_plugins_part_2.py", "test_proxy.py", "test_upgrade.py", "test_external_agent.py"]'
pre-run-script: |
-c "sudo microk8s config > ${GITHUB_WORKSPACE}/kube-config
chmod +x tests/integration/pre_run_script.sh
./tests/integration/pre_run_script.sh"
juju-channel: 3.1/stable
juju-channel: 3/stable
self-hosted-runner: true
self-hosted-runner-label: "xlarge"
microk8s-addons: "dns ingress rbac storage metallb:10.15.119.2-10.15.119.4 registry"
microk8s-addons: "dns ingress rbac hostpath-storage metallb:10.15.119.2-10.15.119.4 registry"
tmate-debug: true
tmate-timeout: 90
1 change: 1 addition & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Pebble CVEs
CVE-2024-24790

Check notice on line 2 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2024-24790 not present anymore, can be safely removed.
CVE-2023-45288

Check notice on line 3 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2023-45288 not present anymore, can be safely removed.
CVE-2024-34156

Check notice on line 4 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2024-34156 not present anymore, can be safely removed.
# Jenkins plugin manager CVEs
CVE-2023-5072

Check notice on line 6 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2023-5072 not present anymore, can be safely removed.
# Jenkins CVEs
CVE-2016-1000027

Check notice on line 8 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2016-1000027 not present anymore, can be safely removed.
CVE-2024-47072

Check notice on line 9 in .trivyignore

View workflow job for this annotation

GitHub Actions / integration-tests / Scan Image (ghcr.io-canonical-jenkins-cfe2f20c06d9bbd2e91e9cd0844d540162a09cd2-_1.0_amd64.tar)

CVE-2024-47072 not present anymore, can be safely removed.
23 changes: 18 additions & 5 deletions jenkins_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,30 @@ parts:
- curl
- libnss3
- unzip
- default-jdk-headless
- openjdk-21-jdk-headless
# Referred from https://github.com/jenkinsci/docker/blob/master/debian/bookworm/hotspot/Dockerfile
overlay-packages:
- bash
- ca-certificates
- ca-certificates-java
- curl
- fonts-dejavu-core
- libfontconfig1
- default-jre-headless
- git
- gnupg
- gpg
- libfontconfig1
- libfreetype6
- libharfbuzz0b
- openjdk-21-jre-headless
- procps
- ssh-client
- tini
- tzdata
- wget
- unzip
build-environment:
- JENKINS_VERSION: 2.462.2
- JENKINS_PLUGIN_MANAGER_VERSION: 2.12.13
- JENKINS_VERSION: 2.479.1
- JENKINS_PLUGIN_MANAGER_VERSION: 2.13.2
override-build: |
mkdir -p ${CRAFT_PART_INSTALL}/{srv/jenkins/,etc/default/jenkins/}
# Use jenkins war rather than apt install for easier Jenkins version control.
Expand Down
35 changes: 18 additions & 17 deletions src-docs/jenkins.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Functions to operate Jenkins.
**Global Variables**
---------------
- **WEB_PORT**
- **JENKINS_PLUGIN_MANAGER_VERSION**
- **LOGIN_PATH**
- **JUJU_API_TOKEN**
- **REQUIRED_PLUGINS**
Expand All @@ -30,7 +31,7 @@ Functions to operate Jenkins.

---

<a href="../src/jenkins.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L118"><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 +55,7 @@ Retrieve admin credentials.

---

<a href="../src/jenkins.py#L691"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L692"><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 +85,7 @@ Return whether the Jenkins home directory is mounted and owned by jenkins.

---

<a href="../src/jenkins.py#L745"><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 +104,7 @@ Install default jenkins-config.xml.

---

<a href="../src/jenkins.py#L754"><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 +123,7 @@ Install jenkins-config.xml for auth_proxy.

---

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

## <kbd>function</kbd> `install_logging_config`

Expand All @@ -141,7 +142,7 @@ Install logging config.

---

<a href="../src/jenkins.py#L867"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L868"><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 @@ -202,7 +203,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#L163"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L164"><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 @@ -256,7 +257,7 @@ Returns: the web URL.

---

<a href="../src/jenkins.py#L436"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L437"><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 @@ -281,7 +282,7 @@ Add a Jenkins agent node.

---

<a href="../src/jenkins.py#L353"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L354"><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 @@ -311,7 +312,7 @@ Initialize and install Jenkins.

---

<a href="../src/jenkins.py#L378"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L379"><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 @@ -341,7 +342,7 @@ Get node secret from jenkins.

---

<a href="../src/jenkins.py#L456"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L457"><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 @@ -366,7 +367,7 @@ Remove a Jenkins agent node.

---

<a href="../src/jenkins.py#L586"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L587"><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 @@ -396,7 +397,7 @@ Remove plugins that are not in the list of desired plugins.

---

<a href="../src/jenkins.py#L558"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L559"><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 @@ -425,7 +426,7 @@ Invalidate all Jenkins sessions and create new password for admin account.

---

<a href="../src/jenkins.py#L504"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/jenkins.py#L505"><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 @@ -449,7 +450,7 @@ Safely restart Jenkins server after all jobs are done executing.

---

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

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

Expand All @@ -467,7 +468,7 @@ Update jenkins 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>
<a href="../src/jenkins.py#L224"><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 @@ -529,7 +530,7 @@ Represents an error probing for Jenkins storage mount.

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

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

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

Expand Down
3 changes: 2 additions & 1 deletion src/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
logger = logging.getLogger(__name__)

WEB_PORT = 8080
JENKINS_PLUGIN_MANAGER_VERSION = "2.13.2"
LOGIN_PATH = "/login?from=%2F"
EXECUTABLES_PATH = Path("/srv/jenkins/")
JENKINS_HOME_PATH = Path("/var/lib/jenkins")
Expand Down Expand Up @@ -841,7 +842,7 @@ def _install_plugins(
"java",
*proxy_args,
"-jar",
"jenkins-plugin-manager-2.12.13.jar",
f"jenkins-plugin-manager-{JENKINS_PLUGIN_MANAGER_VERSION}.jar",
"-w",
"jenkins.war",
"-d",
Expand Down
Loading
Loading