blob: bc1b63a92ec429fa9cbc43319de5fc1b03a73ee3 [file] [log] [blame]
SF initial configuratora26c41e2022-10-06 13:33:13 +03001# This file is managed by ansible, do not edit directly
2---
3- name: start the project
4 openshift_raw:
5 state: present
6 namespace: "{{ zuul.resources['project'].namespace }}"
7 context: "{{ zuul.resources['project'].context }}"
8 definition:
9 apiVersion: v1
10 kind: DeploymentConfig
11 metadata:
12 generation: 2
13 labels:
14 app: "{{ zuul.project.short_name }}"
15 name: "{{ zuul.project.short_name }}"
16 spec:
17 replicas: 1
18 selector:
19 deploymentconfig: "{{ zuul.project.short_name }}"
20 strategy:
21 resources: {}
22 type: Rolling
23 template:
24 metadata:
25 labels:
26 app: "{{ zuul.project.short_name }}"
27 deploymentconfig: "{{ zuul.project.short_name }}"
28 spec:
29 containers:
30 - image: "{{ _image_stream.result.status.dockerImageRepository }}"
31 name: "{{ zuul.project.short_name }}"
32 command: [ "/bin/bash", "-c", "--" ]
33 args: [ "while true; do sleep 30; done;" ]
34 ports:
35 - containerPort: 8080
36 protocol: TCP
37 - containerPort: 8443
38 protocol: TCP
39 resources: {}
40 dnsPolicy: ClusterFirst
41 restartPolicy: Always
42 schedulerName: default-scheduler
43 securityContext: {}
44 terminationGracePeriodSeconds: 30
45 test: false
46
47- name: get project pod name
48 command: >
49 {{ oc_command }} get pods --field-selector=status.phase=Running
50 -o "jsonpath={.items[?(@.metadata.labels.app=='{{ zuul.project.short_name }}')].metadata.name}"
51 register: _pod_name
52 retries: 600
53 delay: 1
54 until: "zuul.project.short_name in _pod_name.stdout"
55
56- name: create pods list
57 set_fact:
58 pods_data:
59 pods:
60 - name: "{{ zuul.project.short_name }}"
61 pod: "{{ _pod_name.stdout }}"
62
63- name: store pods list in work_root
64 copy:
65 content: "{{ pods_data | to_yaml }}"
66 dest: "{{ zuul.executor.work_root }}/pods.yaml"