10000 building wal-g from source · octavetn/postgres@78df02d · GitHub
[go: up one dir, main page]

Skip to content

Commit 78df02d

Browse files
committed
building wal-g from source
so that it works on arm as well
1 parent e110e81 commit 78df02d

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

ansible/tasks/setup-misc.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,46 @@
55
pkg:
66
- daemontools
77

8-
- name: WAL-G - download latest release
8+
- name: wal-g system dependencies
9+
apt:
10+
pkg:
11+
- liblzo2-dev
12+
- cmake
13+
- build-essential
14+
15+
# find platform architecture
16+
- name: finding platform architecture
17+
shell: if [ $(uname -m) = "aarch64" ]; then echo "arm64"; else echo "amd64"; fi
18+
register: platform_output
19+
- set_fact:
20+
platform: "{{ platform_output.stdout }}"
21+
22+
# install go dependency for WAL-G
23+
- name: wal-g go dependency
924
get_url:
10-
url: https://github.com/wal-g/wal-g/releases/download/v{{ wal_g_release }}/wal-g.linux-amd64.tar.gz
25+
url: "https://golang.org/dl/go{{ golang_version }}.linux-{{ platform }}.tar.gz"
1126
dest: /tmp
12-
checksum: "{{ wal_g_release_checksum }}"
13-
14-
- name: WAL-G - unpack archive
27+
- name: unpack go archive
1528
unarchive:
1629
remote_src: yes
17-
src: /tmp/wal-g.linux-amd64.tar.gz
18-
dest: /tmp
19-
become: yes
30+
src: "/tmp/go{{ golang_version }}.linux-{{ platform }}.tar.gz"
31+
dest: /usr/local
32+
33+
# Download WAL-G
34+
- name: download wal-g
35+
shell:
36+
cmd: go get github.com/wal-g/wal-g;
37+
environment:
38+
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin"
39+
ignore_errors: yes
40+
# ignore error https://github.com/wal-g/wal-g/issues/343#issuecomment-514544288
2041

21-
- name: WAL-G - install
42+
# Install WAL-G
43+
- name: install wal-g
2244
become: yes
2345
shell:
24-
cmd: mv /tmp/wal-g /usr/local/bin/
46+
cmd: make install && make deps && make pg_install
47+
chdir: "{{ ansible_env.HOME }}/go/src/github.com/wal-g/wal-g"
48+
environment:
49+
GOBIN: "/usr/local/bin"
50+
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin"

ansible/vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ postgresql_log_filename: "postgresql.log"
4545
postgresql_log_rotation_age: 0
4646
postgresql_log_rotation_size: 0
4747

48+
golang_version: "1.15.4"
4849
wal_g_release: "0.2.15"
4950
wal_g_release_checksum: sha1:e82d405121e0ccc322a323b9824e60c102b14004

0 commit comments

Comments
 (0)
0