-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook_deploy.yaml
63 lines (46 loc) · 1.95 KB
/
playbook_deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- name: Start CRC 1.8.0 and deploy Openshift Drools Hacep
hosts: localhost
gather_facts: true
vars:
libvirt_version: "4.3.8"
kube_password: "{{ lookup('file', '/home/{{ ansible_user_id }}/.crc/cache/crc_libvirt_{{ libvirt_version }}/kubeadmin-password') }}"
vars_prompt:
- name: "nameSpace"
prompt: "Insert your Project Name/ NameSpace"
default: "my-kafka-project"
private: "no"
tasks:
-
- debug: msg="Project Name {{ nameSpace }}"
- name: Clone Hacep repo
become: false
git:
repo: "https://github.com/kiegroup/openshift-drools-hacep.git"
dest: "/tmp/openshift-drools-hacep"
accept_hostkey: true
version: master
- name: Running mvn clean install
shell: "cd /tmp/openshift-drools-hacep && mvn clean install -DskipTests"
register: mvn_result
- debug: msg="{{ mvn_result }}"
- name: Start CRC with 16GB (~ 10 minutes)
shell: "crc start config set memory 16384"
register: crc_result
- debug: msg="{{ crc_result }}"
- name: Add .crc/bin to the path
shell: "export PATH=$PATH:/home/{{ansible_user_id}}/.crc/bin/"
- name: Login crc
shell: "oc login -u kubeadmin -p {{ kube_password }} https://api.crc.testing:6443"
- name: Switch to {{ nameSpace}}
shell: "oc project {{ nameSpace }}"
- name: Binary Build
shell: "cd /tmp/openshift-drools-hacep/springboot/ && oc new-build --binary --strategy=docker --name openshift-kie-springboot"
- name: Build
shell: "cd /tmp/openshift-drools-hacep/springboot/ && oc start-build openshift-kie-springboot --from-dir=. --follow "
- name: Deploy Hacep
shell: "oc create -f ./kubernetes/deployment.yaml"
- name: Open browser
shell: "crc console"
- debug: msg="Project Name {{ nameSpace }}"
- debug: msg="Your Kube Password is {{ kube_password }}"