Skip to content

Commit

Permalink
Add bazel role
Browse files Browse the repository at this point in the history
  • Loading branch information
Yikun committed Aug 22, 2019
1 parent 0de6748 commit 89eebd4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/config-bazel/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
bazel_version: '0.28.1'
23 changes: 23 additions & 0 deletions roles/config-bazel/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# We can install specify version bazel in task, like this:
#- roles:
# - role: config-bazel
# bazel_version: '0.28.1'
---
- name: Check if bazel has satisfied requirement
shell: bazel --version |grep -Eo '([0-9]+\.)+[0-9]+'
ignore_errors: yes
register: curr_bazel_version

- name: Install bazel
shell: |
set -ex
apt-get update
apt-get -y install build-essential openjdk-8-jdk python zip unzip
wget https://github.com/theopenlab/package/releases/download/master/bazel.{{ bazel_version }}
chmod +x ./bazel.{{ bazel_version }}
cp bazel.{{ bazel_version }} /usr/local/bin/bazel
bazel version
when:
- curr_bazel_version.stdout != bazel_version
args:
executable: /bin/bash

0 comments on commit 89eebd4

Please sign in to comment.