Browse Source

separate build and setup

Anuj Bansal 3 years ago
parent
commit
188f436824

+ 12 - 3
devops/aws/build-code.yml

@@ -1,7 +1,7 @@
 ---
 
 - name: Get latest Joystream code, build it and copy binary to local
-  hosts: build
+  hosts: build,rpc
   gather_facts: no
   tasks:
     - name: Get code from local or git repo
@@ -9,10 +9,19 @@
         name: common
         tasks_from: "{{ 'get-code-local' if build_local_code|bool else 'get-code-git' }}"
 
-    - name: Run setup and build
+    - name: Run setup
+      include_role:
+        name: common
+        tasks_from: run-setup
+
+- name: Build code and copy binary to local
+  hosts: build
+  gather_facts: no
+  tasks:
+    - name: Run build
       include_role:
         name: common
-        tasks_from: run-setup-build
+        tasks_from: run-build
 
     - name: Copy joystream-node binary from build to local
       fetch:

+ 7 - 2
devops/aws/create-joystream-node-ami-playbook.yml

@@ -10,10 +10,15 @@
         name: common
         tasks_from: get-code-git
 
-    - name: Run setup and build
+    - name: Run setup
       include_role:
         name: common
-        tasks_from: run-setup-build
+        tasks_from: run-setup
+
+    - name: Run build
+      include_role:
+        name: common
+        tasks_from: run-build
 
     - name: Install subkey
       include_role:

+ 1 - 9
devops/aws/roles/common/tasks/run-setup-build.yml → devops/aws/roles/common/tasks/run-build.yml

@@ -1,13 +1,5 @@
 ---
-# Run setup and build code
-
-- name: Create bash profile file
-  command: 'touch /home/ubuntu/.bash_profile'
-
-- name: Run setup script
-  command: ./setup.sh
-  args:
-    chdir: '{{ remote_code_path }}'
+# Build code
 
 - name: Build joystream node
   shell: . ~/.bash_profile && yarn cargo-build

+ 10 - 0
devops/aws/roles/common/tasks/run-setup.yml

@@ -0,0 +1,10 @@
+---
+# Run setup
+
+- name: Create bash profile file
+  command: 'touch /home/ubuntu/.bash_profile'
+
+- name: Run setup script
+  command: ./setup.sh
+  args:
+    chdir: '{{ remote_code_path }}'