Skip to content

Commit

Permalink
Support for cross-compiling in provisioning files.
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman committed Mar 27, 2019
1 parent c80a4a5 commit 956cd55
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ COPY . /go/src/github.com/bbva/qed
# Move C deps to current working dir.
RUN mv /tmp/qed/c-deps/* c-deps/

# Build QED binary
RUN go build -o /usr/local/bin/qed
# Build QED, Storage binary and riot
RUN go build -o /usr/local/bin/qed &&\
go build -o /usr/local/bin/riot tests/riot.go &&\
go build -o /usr/local/bin/storage tests/gossip/test_service.go

# Clean
RUN rm -rf /var/lib/apt/lists/* /tmp/qed
1 change: 1 addition & 0 deletions deploy/aws/provision/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
---
- hosts: localhost
connection: local
gather_facts: true
vars_files:
- vars.yml
environment:
Expand Down
13 changes: 12 additions & 1 deletion deploy/aws/provision/tasks/common/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,21 @@
path: config_files/bin
state: directory

- name: Build QED, Inmemory Storage and Riot
- name: Build QED, Inmemory Storage and Riot on Linux
shell: >
go build -o {{ item }}
with_items:
- config_files/bin/qed ../../../
- config_files/bin/storage ../../../tests/gossip/test_service.go
- config_files/bin/riot ../../../tests/riot.go
when: ansible_system == 'Linux'

- name: Build QED, Inmemory Storage and Riot on MacOS
shell: >
{{ item }}
with_items:
- docker build -t qed/build ../../../
- docker run -d --name qed qed/build:latest
- docker cp qed:/usr/local/bin/. config_files/bin
- docker rm -vf qed
when: ansible_system == 'Darwin'

0 comments on commit 956cd55

Please sign in to comment.