feat: finalize projectwork CI jobs, docs and test integration

This commit is contained in:
2026-04-23 11:39:08 +03:00
parent 737bddd631
commit 20bdacf5c5
39 changed files with 1819 additions and 70 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
---
- name: Destroy OTUS HW8 Jenkins infrastructure
- name: Destroy OTUS ProjectWork Jenkins infrastructure
hosts: local
gather_facts: false
vars:
hw8_root: "{{ playbook_dir }}/../.."
compose_dir: "{{ hw8_root }}/compose"
project_root: "{{ playbook_dir }}/../.."
compose_dir: "{{ project_root }}/compose"
compose_file: "{{ compose_dir }}/docker-compose.yml"
compose_env_file: "{{ compose_dir }}/.env"
+33 -7
View File
@@ -1,16 +1,17 @@
---
- name: Deploy OTUS HW8 Jenkins infrastructure
- name: Deploy OTUS ProjectWork Jenkins infrastructure
hosts: local
gather_facts: true
vars:
hw8_root: "{{ playbook_dir }}/../.."
compose_dir: "{{ hw8_root }}/compose"
project_root: "{{ playbook_dir }}/../.."
compose_dir: "{{ project_root }}/compose"
compose_file: "{{ compose_dir }}/docker-compose.yml"
compose_env_file: "{{ compose_dir }}/.env"
selenoid_video_output_dir: "{{ compose_dir }}/selenoid/video"
jobs_profile_effective: "{{ jobs_profile | default('full') }}"
jjb_paths:
full: /workspace/hw8/config/jobs
devops: /workspace/hw8/config/jobs-devops
full: /workspace/projectwork/config/jobs
devops: /workspace/projectwork/config/jobs-devops
jjb_upload_path: "{{ jjb_paths.get(jobs_profile_effective, jjb_paths.full) }}"
tasks:
@@ -42,11 +43,13 @@
delay: 20
until: pull_jenkins_base.rc == 0
- name: Build and start registry, jenkins and nginx
- name: Build and start core services (registry, jenkins, nginx, selenoid)
ansible.builtin.command:
cmd: docker compose -f {{ compose_file }} --env-file {{ compose_env_file }} up -d --build registry jenkins nginx
cmd: docker compose -f {{ compose_file }} --env-file {{ compose_env_file }} up -d --build registry jenkins nginx selenoid selenoid-ui
args:
chdir: "{{ compose_dir }}"
environment:
SELENOID_VIDEO_OUTPUT_DIR: "{{ selenoid_video_output_dir }}"
register: compose_bootstrap
retries: 4
delay: 20
@@ -61,6 +64,23 @@
delay: 5
until: jenkins_ready.status == 200
- name: Wait for Selenoid to become available
ansible.builtin.uri:
url: "http://127.0.0.1:4444/status"
status_code: 200
register: selenoid_ready
retries: 60
delay: 5
until: selenoid_ready.status == 200
- name: Pre-pull Selenoid browser and recorder images
ansible.builtin.command:
cmd: docker pull {{ item }}
loop:
- selenoid/vnc:chrome_128.0
- selenoid/vnc:firefox_125.0
- selenoid/video-recorder:latest-release
- name: Build and push slave/test images to local registry
ansible.builtin.command:
cmd: ./scripts/build_and_push_images.sh localhost:5005 1.0.0
@@ -76,12 +96,16 @@
cmd: docker compose -f {{ compose_file }} --env-file {{ compose_env_file }} up -d agent-maven agent-jjb
args:
chdir: "{{ compose_dir }}"
environment:
SELENOID_VIDEO_OUTPUT_DIR: "{{ selenoid_video_output_dir }}"
- name: Build jobs_uploader image with latest changes
ansible.builtin.command:
cmd: docker compose -f {{ compose_file }} --env-file {{ compose_env_file }} build jobs_uploader
args:
chdir: "{{ compose_dir }}"
environment:
SELENOID_VIDEO_OUTPUT_DIR: "{{ selenoid_video_output_dir }}"
- name: Remove stale jobs_uploader run containers
ansible.builtin.shell: |
@@ -97,6 +121,8 @@
cmd: timeout 900 docker compose -f {{ compose_file }} --env-file {{ compose_env_file }} run --rm -e JJB_PATH={{ jjb_upload_path }} jobs_uploader
args:
chdir: "{{ compose_dir }}"
environment:
SELENOID_VIDEO_OUTPUT_DIR: "{{ selenoid_video_output_dir }}"
- name: Show endpoint details
ansible.builtin.debug: