summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mazuruk <a.mazuruk@samsung.com>2018-10-02 20:35:30 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2019-10-17 14:47:49 +0200
commit54b183b5b76bbad0d62e3d5d1cccd40b201be004 (patch)
tree03f70882b99af1c8d879b9492b6e3373c591ee4e
parent6c0f86339edbb4718ff6b63c1048d4be7e179b6d (diff)
downloadslav-54b183b5b76bbad0d62e3d5d1cccd40b201be004.tar.gz
slav-54b183b5b76bbad0d62e3d5d1cccd40b201be004.tar.bz2
slav-54b183b5b76bbad0d62e3d5d1cccd40b201be004.zip
Add initial build recipes for Dryad (on ARMv7) and Weles
This patch provides new ansible roles for Weles and Dryad. Dryad executables ("dryad" from Boruta and "stm", "fota" from MuxPi) are built for ARMv7 by default. Ansible inventory for Vagrant machine has been modified accordingly. This environment is suggested for the first time users to minimize initial overhead. Change-Id: I508dce8bab2947b3dd0f811ce47a13b8e094c551 Signed-off-by: Alexander Mazuruk <a.mazuruk@samsung.com> Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
-rw-r--r--ansible/main.yml14
-rw-r--r--ansible/roles/slav/dryad/meta/main.yml3
-rw-r--r--ansible/roles/slav/dryad/tasks/main.yml63
-rw-r--r--ansible/roles/slav/weles/meta/main.yml3
-rw-r--r--ansible/roles/slav/weles/tasks/main.yml34
-rw-r--r--vagrant/Vagrantfile10
6 files changed, 123 insertions, 4 deletions
diff --git a/ansible/main.yml b/ansible/main.yml
index cf3c1c3..59f9493 100644
--- a/ansible/main.yml
+++ b/ansible/main.yml
@@ -7,7 +7,19 @@
- common/ansible_runable
- common/packages_uptodate
-- name: Deploy Boruta
+- name: Build Dryad executables for ARMv7
+ hosts: boruta_srv
+ vars:
+ build_flags_muxpi: GOOS=linux GOARCH=arm GOARM=7
+ roles:
+ - slav/dryad
+
+- name: Build Boruta
hosts: boruta_srv
roles:
- slav/boruta
+
+- name: Build Weles
+ hosts: weles_srv
+ roles:
+ - slav/weles
diff --git a/ansible/roles/slav/dryad/meta/main.yml b/ansible/roles/slav/dryad/meta/main.yml
new file mode 100644
index 0000000..9a08e1a
--- /dev/null
+++ b/ansible/roles/slav/dryad/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - { role: andrewrothstein.go }
diff --git a/ansible/roles/slav/dryad/tasks/main.yml b/ansible/roles/slav/dryad/tasks/main.yml
new file mode 100644
index 0000000..5cba7d1
--- /dev/null
+++ b/ansible/roles/slav/dryad/tasks/main.yml
@@ -0,0 +1,63 @@
+---
+- name: Install git
+ apt: name=git state=present
+
+- name: Create GOPATH directory
+ file: path={{ hostvars[inventory_hostname].gopath }} state=directory
+ when: GOPATH is undefined
+
+- name: Create directory for SLAV
+ file:
+ path: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV"
+ state: directory
+
+- name: Create directory for ARMv7 executables
+ file:
+ path: "{{ hostvars[inventory_hostname].gopath }}/bin/linux_armv7"
+ state: directory
+
+- name: Get MuxPi src
+ git:
+ repo: 'https://github.com/SamsungSLAV/muxpi'
+ dest: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/muxpi"
+ version: 'v0.1.0'
+
+- name: Get dependencies
+ command: /usr/local/go/bin/go get ./...
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/muxpi"
+
+- name: Build stm executable
+ shell: >
+ {{ build_flags_muxpi }} /usr/local/go/bin/go build
+ -o "{{ hostvars[inventory_hostname].gopath }}/bin/linux_armv7/stm"
+ ./sw/nanopi/cmd/stm
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/muxpi"
+
+- name: Build fota executable
+ shell: >
+ {{ build_flags_muxpi }} /usr/local/go/bin/go build
+ -o "{{ hostvars[inventory_hostname].gopath }}/bin/linux_armv7/fota"
+ ./sw/nanopi/cmd/fota
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/muxpi"
+
+- name: Get Boruta src
+ git:
+ repo: 'https://github.com/SamsungSLAV/boruta'
+ dest: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/boruta"
+ version: 'v0.1.0'
+
+- name: Get dependencies
+ command: /usr/local/go/bin/go get ./...
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/boruta"
+
+- name: Build dryad executable
+ shell: >
+ {{ build_flags_muxpi }} /usr/local/go/bin/go build
+ -o "{{ hostvars[inventory_hostname].gopath }}/bin/linux_armv7/dryad"
+ ./cmd/dryad
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/boruta"
diff --git a/ansible/roles/slav/weles/meta/main.yml b/ansible/roles/slav/weles/meta/main.yml
new file mode 100644
index 0000000..9a08e1a
--- /dev/null
+++ b/ansible/roles/slav/weles/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - { role: andrewrothstein.go }
diff --git a/ansible/roles/slav/weles/tasks/main.yml b/ansible/roles/slav/weles/tasks/main.yml
new file mode 100644
index 0000000..43128a6
--- /dev/null
+++ b/ansible/roles/slav/weles/tasks/main.yml
@@ -0,0 +1,34 @@
+---
+- name: Install git
+ become: true
+ apt: name=git state=present
+
+- name: Install GCC
+ become: true
+ apt: name=gcc state=present
+
+- name: Create GOPATH directory
+ file: path={{ hostvars[inventory_hostname].gopath }} state=directory
+ when: GOPATH is undefined
+
+- name: Create directory for SLAV
+ file:
+ path: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV"
+ state: directory
+
+- name: Get Boruta src
+ git:
+ repo: 'https://github.com/SamsungSLAV/boruta'
+ dest: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/boruta"
+ version: 'v0.1.0'
+
+- name: Get Weles src
+ git:
+ repo: 'https://github.com/SamsungSLAV/weles'
+ dest: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/weles"
+ version: 'v0.1.0'
+
+- name: Get dependencies and install named packages
+ command: /usr/local/go/bin/go get ./...
+ args:
+ chdir: "{{ hostvars[inventory_hostname].gopath }}/src/github.com/SamsungSLAV/weles"
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
index b612250..1bf34ba 100644
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -16,11 +16,15 @@ Vagrant.configure("2") do |config|
config.vm.provision "ansible" do |ansible|
ansible.playbook = "../ansible/main.yml"
ansible.groups = {
- "all_srvs:children" => "boruta_srv",
+ "all_srvs:children" => [ "boruta_srv", "weles_srv" ],
"boruta_srv" => "default",
"boruta_srv:vars" => {
- "gopath" => "~/go"
- }
+ "gopath" => "${HOME}/go"
+ },
+ "weles_srv" => "default",
+ "weles_srv:vars" => {
+ "gopath" => "${HOME}/go"
+ },
}
end
end