Skip to content

Commit

Permalink
Fix rocksdb git references
Browse files Browse the repository at this point in the history
  • Loading branch information
amaczuga committed Jul 11, 2017
1 parent 1d620e7 commit 22331ab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ rocksdb_install_dir: "/usr/local"

rocksdb_sw_name: "rocksdb"

# software version
rocksdb_sw_release: "5.2.1"
# software version (tag, branch, commit_id)
rocksdb_sw_version: "5.2.1"

# software source archive location
rocksdb_sw_release_archive: "https://github.com/facebook/rocksdb/archive/v{{ rocksdb_sw_release }}.tar.gz"
rocksdb_sw_version_archive: "https://github.com/facebook/rocksdb/archive/{{ rocksdb_sw_version }}.tar.gz"
```
Dependencies
Expand Down
11 changes: 8 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
rocksdb_build_dir: "/var/tmp/build"

rocksdb_build_dir_clean: False

# software install destination directory
rocksdb_install_dir: "/usr/local"

# binary tools dir suffix
rocksdb_binary_subdir: "bin"

rocksdb_sw_name: "rocksdb"

# software version
rocksdb_sw_release: "5.2.1"
# software version (tag, branch, commit_id)
rocksdb_sw_version: "master"

# software source archive location
rocksdb_sw_release_archive: "https://github.com/facebook/rocksdb/archive/v{{ rocksdb_sw_release }}.tar.gz"
rocksdb_sw_version_archive: "https://github.com/facebook/rocksdb/archive/{{ rocksdb_sw_version }}.tar.gz"

rocksdb_os_devel_packages: []

Expand Down
15 changes: 12 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,29 @@
become: yes
environment: "{{ rocksdb_proxy_env }}"

- name: "clean up build directory"
file:
path: "{{ rocksdb_build_dir }}"
state: absent
when: rocksdb_build_dir_clean

- name: "prepare build and install directory"
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ rocksdb_build_dir }}"
- "{{ rocksdb_src_dir }}"
- "{{ rocksdb_install_dir }}"
- "{{ rocksdb_install_dir }}/bin"
- "{{ rocksdb_install_dir }}/{{ rocksdb_binary_subdir }}"

- name: "download rocksdb source package"
unarchive:
src: "{{ rocksdb_sw_release_archive }}"
src: "{{ rocksdb_sw_version_archive }}"
dest: "{{ rocksdb_build_dir }}"
creates: "{{ rocksdb_src_dir }}/Makefile"
extra_opts:
- "--strip-components=1"
remote_src: yes
validate_certs: no
environment: "{{ rocksdb_proxy_env }}"
Expand All @@ -50,7 +59,7 @@
changed_when: "false"

- name: "install rocksdb tools"
command: "install -C -v -m 755 {{ item }} {{ rocksdb_install_dir }}/bin/{{ item|basename }}"
command: "install -C -v -m 755 {{ item }} {{ rocksdb_install_dir }}/{{ rocksdb_binary_subdir }}/{{ item|basename }}"
with_items: "{{ rocksdb_sw_tools.stdout_lines }}"
register: "installed"
changed_when: installed.stdout != ""
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ rocksdb_proxy_env:
https_proxy: "{{ lookup('env', 'https_proxy') }}"
socks_proxy: "{{ lookup('env', 'socks_proxy') }}"

rocksdb_src_dir: "{{ rocksdb_build_dir }}/{{ rocksdb_sw_name }}-{{ rocksdb_sw_release }}"
rocksdb_src_dir: "{{ rocksdb_build_dir }}/{{ rocksdb_sw_name }}-{{ rocksdb_sw_version }}"

0 comments on commit 22331ab

Please sign in to comment.