Skip to content

Commit

Permalink
Update jenkins
Browse files Browse the repository at this point in the history
Signed-off-by: Jack <[email protected]>
  • Loading branch information
zhan9san committed Aug 23, 2024
1 parent bd343f8 commit bb86ed1
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 63 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- distro: ubuntu2204
distro:
- rockylinux9
- ubuntu2204
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -39,6 +40,7 @@ jobs:
- name: Run Molecule tests.
run: molecule test
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}

# - name: Setup tmate session
Expand All @@ -53,25 +55,23 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- distro: centos7
distro:
- centos7
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

# If ansible>=10, then ansible-core>=2.17
# https://github.com/ansible/ansible/issues/82068
- name: Install test dependencies.
run: pip3 install ansible molecule-plugins[docker]
run: pip3 install ansible==9.9.0 molecule-plugins[docker]

- name: Run Molecule tests.
run: molecule test
env:
MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}

# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
jenkins_prefer_lts: true
jenkins_version: "2.387.2"
jenkins_version: "2.452.4"

jenkins_process_user: jenkins
jenkins_process_group: "{{ jenkins_process_user }}"
Expand Down Expand Up @@ -29,6 +29,8 @@ jenkins_url: "{{ jenkins_schema }}://{{ jenkins_server_name }}/"
jenkins_webroot_directory: '/var/cache/jenkins/war'

# For plugin
java_bin: "{{ java_home | default('') | ternary(java_home + '/bin/java', 'java') }}"

jenkins_plugin_manager_version: "2.12.9"
jenkins_plugin_manager_url: "https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/{{ jenkins_plugin_manager_version }}/jenkins-plugin-manager-{{ jenkins_plugin_manager_version }}.jar" # yamllint disable-line rule:line-length

Expand Down
79 changes: 41 additions & 38 deletions files/plugins.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
artifactory:3.18.3
authorize-project:1.6.0
aws-credentials:191.vcb_f183ce58b_9
basic-branch-build-strategies:71.vc1421f89888e
bitbucket:223.vd12f2bca5430
blueocean:1.27.4
artifactory:4.0.8
authorize-project:1.7.2
aws-credentials:231.v08a_59f17d742
basic-branch-build-strategies:81.v05e333931c7d
bitbucket:254.v9d8ec33a_7a_42
blueocean:1.27.14
buildtriggerbadge:251.vdf6ef853f3f5
cloudbees-bitbucket-branch-source:803.vd9c5e84c41fa_
command-launcher:100.v2f6722292ee8
configuration-as-code:1625.v27444588cc3d
credentials:1224.vc23ca_a_9a_2cb_0
credentials-binding:604.vb_64480b_c56ca_
dashboard-view:2.487.vcf0ff9008a_c0
docker-plugin:1.3.8
extended-choice-parameter:373.v1a_ecea_fdf2a_a_
file-operations:1.11
generic-webhook-trigger:1.86.3
git:5.0.2
http_request:1.16
jacoco:3.3.3
javax-mail-api:1.6.2-9
jdk-tool:66.vd8fa_64ee91b_d
cloudbees-bitbucket-branch-source:888.v8e6d479a_1730
command-launcher:115.vd8b_301cc15d0
configuration-as-code:1836.vccda_4a_122a_a_e
credentials:1371.vfee6b_095f0a_3
credentials-binding:681.vf91669a_32e45
dashboard-view:2.517.v776a_b_811a_b_4e
docker-plugin:1.6.2
extended-choice-parameter:382.v5697b_32134e8
file-operations:266.v9d4e1eb_235b_a_
file-parameters:339.v4b_cc83e11455
generic-webhook-trigger:2.2.2
git:5.3.0
groovy-events-listener-plugin:2.210.v8a_4107f66127
http_request:1.19
jacoco:3.3.6
javax-mail-api:1.6.2-10
jdk-tool:80.v8a_dee33ed6f0
jira-steps:2.0.165.v8846cf59f3db
job-dsl:1.82
kubernetes:3937.vd7b_82db_e347b_
kubernetes-cli:1.12.0
ldap:682.v7b_544c9d1512
matrix-auth:3.1.7
job-dsl:1.87
kubernetes:4285.v50ed5f624918
kubernetes-cli:1.12.1
ldap:725.v3cb_b_711b_1a_ef
matrix-auth:3.2.2
next-build-number:1.8
Office-365-Connector:4.18.0
pipeline-stage-view:2.32
pipeline-utility-steps:2.15.3
Parameterized-Remote-Trigger:3.1.6.3
rebuild:320.v5a_0933a_e7d61
Office-365-Connector:4.21.5
pipeline-stage-view:2.34
pipeline-utility-steps:2.17.0
Parameterized-Remote-Trigger:3.2.0
rebuild:332.va_1ee476d8f6d
rich-text-publisher-plugin:1.4
sectioned-view:1.25
sonar:2.15
sshd:3.303.vefc7119b_ec23
throttle-concurrents:2.13
timestamper:1.25
workflow-aggregator:596.v8c21c963d92d
ws-cleanup:0.45
sectioned-view:1.27
snakeyaml-api:2.2-121.v5a_68b_9300b_d4
sonar:2.17.2
sshd:3.330.vc866a_8389b_58
throttle-concurrents:2.14
timestamper:1.27
workflow-aggregator:600.vb_57cdd26fdd7
ws-cleanup:0.46
xml-job-to-job-dsl:0.1.13
8 changes: 8 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
- name: Converge
hosts: all
vars:
jdk_version: 21.0.2
java_home: "/opt/jdk-21.0.2"
jenkins_systemd_unit_envs:
java_home: "{{ java_home }}"
tasks:
- name: "Include zhan9san.java"
ansible.builtin.include_role:
name: "zhan9san.java"
- name: "Include zhan9san.jenkins"
ansible.builtin.include_role:
name: "zhan9san.jenkins"
10 changes: 7 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ dependency:
driver:
name: docker
platforms:
- name: ubuntu2204
image: "geerlingguy/docker-ubuntu2204-ansible:latest"
- name: "$MOLECULE_DISTRO"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux9}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: centos7
image: "geerlingguy/docker-centos7-ansible:latest"
image: "geerlingguy/docker-centos7-ansible:python3"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
inventory:
host_vars:
centos7:
jenkins_nginx_proxy: false
3 changes: 3 additions & 0 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
roles:
- name: zhan9san.java
1 change: 0 additions & 1 deletion tasks/setup-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
- apt-transport-https
- gnupg
- net-tools
- openjdk-11-jdk
state: present
update_cache: true

Expand Down
2 changes: 1 addition & 1 deletion tasks/setup-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- name: Install plugins
ansible.builtin.command:
cmd: "java -jar {{ jenkins_plugin_manager_path }} -w /usr/share/java/jenkins.war -f {{ jenkins_plugin_file_path }} -d {{ jenkins_home }}/plugins {{ jenkins_plugin_manager_proxy_port }} {{ jenkins_plugin_manager_proxy_host }} {{ jenkins_plugin_manager_non_proxy_hosts }}" # yamllint disable-line rule:line-length
cmd: "{{ java_bin }} -jar {{ jenkins_plugin_manager_path }} -w /usr/share/java/jenkins.war -f {{ jenkins_plugin_file_path }} -d {{ jenkins_home }}/plugins {{ jenkins_plugin_manager_proxy_port }} {{ jenkins_plugin_manager_proxy_host }} {{ jenkins_plugin_manager_non_proxy_hosts }}" # yamllint disable-line rule:line-length
when: copy_result.changed # noqa: no-handler
register: command_result
changed_when: true
Expand Down
12 changes: 6 additions & 6 deletions tasks/setup-redhat.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
# https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos
- name: Ensure dependencies are installed.
ansible.builtin.package:
name:
- curl
- java-11-openjdk-devel
state: present
# - name: Ensure dependencies are installed.
# ansible.builtin.dnf:
# name:
# - curl
# allowerasing: true
# state: present

- name: Add Jenkins repo GPG key.
ansible.builtin.rpm_key:
Expand Down

0 comments on commit bb86ed1

Please sign in to comment.