Improve check-services playbook
With this commit, check-services will build own container image with current code and then execute service test. Change-Id: Ie02cea676af2f84254f23df2aebee7d1106c6b27
This commit is contained in:
		 Daniel Pawlik
					Daniel Pawlik
				
			
				
					committed by
					
						 daniel.pawlik
						daniel.pawlik
					
				
			
			
				
	
			
			
			 daniel.pawlik
						daniel.pawlik
					
				
			
						parent
						
							376d6f0880
						
					
				
				
					commit
					9df7239e81
				
			| @@ -12,12 +12,12 @@ | ||||
| # License for the specific language governing permissions and limitations | ||||
| # under the License. | ||||
|  | ||||
| FROM opendevorg/python-builder:3.8 as builder | ||||
| FROM docker.io/opendevorg/python-builder:3.8 as builder | ||||
|  | ||||
| COPY . /tmp/src | ||||
| RUN assemble | ||||
|  | ||||
| FROM opendevorg/python-base:3.8 as logscraper | ||||
| FROM docker.io/opendevorg/python-base:3.8 as logscraper | ||||
|  | ||||
| COPY --from=builder /output/ /output | ||||
| RUN /output/install-from-bindep | ||||
|   | ||||
| @@ -2,23 +2,25 @@ | ||||
| - hosts: all | ||||
|   become: true | ||||
|   vars: | ||||
|     # logscraper | ||||
|     tenant_builds: | ||||
|       - tenant: openstack | ||||
|         gearman_port: 4730 | ||||
|         gearman_server: 0.0.0.0 | ||||
|         zuul_api_url: https://zuul.opendev.org/api/tenant/openstack | ||||
|         zuul_api_urls: | ||||
|           - https://zuul.opendev.org/api/tenant/openstack | ||||
|         insecure: false | ||||
|         job_names: [] | ||||
|     # loggearman - client | ||||
|     source_url: https://0.0.0.0 | ||||
|     # loggearman - worker | ||||
|     output_host: 0.0.0.0 | ||||
|     output_port: 9999 | ||||
|     gearman_host: 0.0.0.0 | ||||
|     gearman_port: 4730 | ||||
|     log_cert_verify: false | ||||
|     # loggearman - client | ||||
|     source_url: "" | ||||
|     gearman_client_host: "{{ gearman_host }}" | ||||
|     gearman_client_port: "{{ gearman_port }}" | ||||
|     # logscraper | ||||
|     tenant_builds: | ||||
|       - tenant: openstack | ||||
|         gearman_port: "{{ gearman_port }}" | ||||
|         gearman_server: "{{ gearman_host }}" | ||||
|         zuul_api_url: https://zuul.opendev.org/api/tenant/openstack | ||||
|         zuul_api_urls: | ||||
|           - https://zuul.opendev.org/api/tenant/openstack | ||||
|         insecure: false | ||||
|         job_names: [] | ||||
|   roles: | ||||
|     - check-services | ||||
|   | ||||
| @@ -4,6 +4,42 @@ | ||||
|     name: podman | ||||
|     state: present | ||||
|  | ||||
| ### BUILD CONTAINER IMAGES ### | ||||
| - name: Build container images | ||||
|   block: | ||||
|     - name: Build logscraper container image | ||||
|       shell: > | ||||
|         podman build -t quay.io/logscraper:dev -f Dockerfile | ||||
|       args: | ||||
|         chdir: "{{ zuul.projects['opendev.org/openstack/ci-log-processing'].src_dir }}" | ||||
|  | ||||
|     - name: Get logscraper image id | ||||
|       shell: | | ||||
|         podman images --noheading quay.io/logscraper:dev  | awk '{print $3}' | ||||
|       register: _logscraper_image_id | ||||
|  | ||||
|     - name: Build logscraper container image | ||||
|       shell: > | ||||
|         podman build -t quay.io/loggearman:dev -f loggearman/Dockerfile | ||||
|       args: | ||||
|         chdir: "{{ zuul.projects['opendev.org/openstack/ci-log-processing'].src_dir }}" | ||||
|  | ||||
|     - name: Get loggearman image id | ||||
|       shell: | | ||||
|         podman images --noheading quay.io/loggearman:dev  | awk '{print $3}' | ||||
|       register: _loggearman_image_id | ||||
|  | ||||
|     - name: Print all images | ||||
|       shell: | | ||||
|         podman images | ||||
|  | ||||
|     - name: Replace container images | ||||
|       set_fact: | ||||
|         container_images: | ||||
|           logscraper: "{{ _logscraper_image_id.stdout }}" | ||||
|           loggearman: "{{ _loggearman_image_id.stdout }}" | ||||
|   when: zuul is defined | ||||
|  | ||||
| ### OPENSEARCH #### | ||||
| - name: Setup Opensearch | ||||
|   shell: > | ||||
|   | ||||
| @@ -39,9 +39,6 @@ | ||||
|     name: podman | ||||
|     state: present | ||||
|  | ||||
| - name: Pull image | ||||
|   shell: "podman pull {{ container_images['loggearman'] }}" | ||||
|  | ||||
| - name: Create configuration files | ||||
|   template: | ||||
|     src: "{{ item }}.yml.j2" | ||||
|   | ||||
| @@ -25,9 +25,6 @@ | ||||
|     name: podman | ||||
|     state: present | ||||
|  | ||||
| - name: Pull image | ||||
|   shell: "podman pull {{ container_images['logscraper'] }}" | ||||
|  | ||||
| - name: Configure logscraper service | ||||
|   include_tasks: service.yml | ||||
|   loop: "{{ tenant_builds }}" | ||||
|   | ||||
| @@ -12,13 +12,13 @@ | ||||
| # License for the specific language governing permissions and limitations | ||||
| # under the License. | ||||
|  | ||||
| FROM opendevorg/python-builder:3.8 as builder | ||||
| FROM docker.io/opendevorg/python-builder:3.8 as builder | ||||
|  | ||||
| ENV OSLO_PACKAGE_VERSION='0.0.1' | ||||
| COPY . /tmp/src | ||||
| RUN assemble | ||||
|  | ||||
| FROM opendevorg/python-base:3.8 as loggearman | ||||
| FROM docker.io/opendevorg/python-base:3.8 as loggearman | ||||
|  | ||||
| COPY --from=builder /output/ /output | ||||
| RUN /output/install-from-bindep | ||||
|   | ||||
		Reference in New Issue
	
	Block a user