Skip to content

Commit

Permalink
feat(andible): add conditions to skip building libraries if working d…
Browse files Browse the repository at this point in the history
…irectories exist (#32)

* feat: add conditions to skip building libraries if working directories exist

Signed-off-by: Manato HIRABAYASHI <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: Manato HIRABAYASHI <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akihito Ohsato <[email protected]>
  • Loading branch information
3 people authored Jun 28, 2023
1 parent 1a0fdd7 commit 8b260ac
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions ansible/roles/ros2/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
path: "{{ source_build_dir }}"
state: directory

- name: Check Boost build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/boost_1_74_0"
register: boost_build_dir_exist

- name: Build and install Boost
block:
- name: "{{ block_name }}: Download and extract source"
Expand All @@ -101,6 +106,12 @@
become: true
vars:
block_name: Boost
when: not boost_build_dir_exist.stat.exists

- name: Check PCL build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/pcl"
register: pcl_build_dir_exist

- name: Build and install PCL
block:
Expand Down Expand Up @@ -128,6 +139,12 @@
become: true
vars:
block_name: PCL
when: not pcl_build_dir_exist.stat.exists

- name: Check fmt build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/fmt-8.1.1"
register: fmt_build_dir_exist

- name: Build and install fmt
block:
Expand All @@ -153,6 +170,12 @@
become: true
vars:
block_name: fmt
when: not fmt_build_dir_exist.stat.exists

- name: Check Range-v3 build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/range-v3"
register: range_v3_build_dir_exist

- name: Build and install Range-v3
block:
Expand All @@ -179,6 +202,12 @@
become: true
vars:
block_name: Range-v3
when: not range_v3_build_dir_exist.stat.exists

- name: Check OpenCV build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/jetson-containers"
register: opencv_build_dir_exist

- name: Build and install OpenCV
block:
Expand All @@ -199,6 +228,12 @@
become: true
vars:
block_name: OpenCV
when: not opencv_build_dir_exist.stat.exists

- name: Check YAML build directory existence
ansible.builtin.stat:
path: "{{ source_build_dir }}/yaml-cpp"
register: yaml_cpp_build_dir_exist

- name: Build and install YAML
block:
Expand All @@ -224,6 +259,7 @@
become: true
vars:
block_name: YAML
when: not yaml_cpp_build_dir_exist.stat.exists

- name: Upgrade CMake
block:
Expand Down Expand Up @@ -281,6 +317,11 @@
vars:
block_name: update GCC

- name: Check ROS build directory existence
ansible.builtin.stat:
path: /opt/ros/{{ ros_distro }}
register: ros_build_dir_exist

- name: Build ROS
block:
- set_fact:
Expand Down Expand Up @@ -385,6 +426,7 @@
become: true
vars:
block_name: Build ROS
when: not ros_build_dir_exist.stat.exists

- name: Downgrade GCC as version 11 is too high for old CUDA version that is used in L4T
block:
Expand Down Expand Up @@ -415,3 +457,4 @@
marker: "# {mark} ros2"
block: |
source {{ ros_base_dir }}/install/setup.bash
when: not ros_build_dir_exist.stat.exists

0 comments on commit 8b260ac

Please sign in to comment.