build-arm64-playbook.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. # Setup joystream code, build docker image
  3. - name: Build image and push to docker hub
  4. hosts: all
  5. tasks:
  6. - block:
  7. - name: Get code from git repo
  8. include_role:
  9. name: common
  10. tasks_from: get-code-git
  11. - name: Install Docker Module for Python
  12. pip:
  13. name: docker
  14. - name: Log into DockerHub
  15. community.docker.docker_login:
  16. username: '{{ docker_username }}'
  17. password: '{{ docker_password }}'
  18. - name: Build an image and push it to a private repo
  19. community.docker.docker_image:
  20. build:
  21. path: ./joystream
  22. dockerfile: '{{ dockerfile }}'
  23. platform: '{{ platform }}'
  24. name: '{{ repository }}'
  25. tag: '{{ tag_name }}'
  26. push: yes
  27. source: build
  28. async: 7200
  29. poll: 0
  30. register: build_result
  31. - name: Check on build async task
  32. async_status:
  33. jid: '{{ build_result.ansible_job_id }}'
  34. register: job_result
  35. until: job_result.finished
  36. retries: 72
  37. delay: 100
  38. always:
  39. - name: Delete the stack
  40. amazon.aws.cloudformation:
  41. stack_name: '{{ stack_name }}'
  42. state: 'absent'
  43. delegate_to: localhost