build-arm64-playbook.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # Setup joystream code, build docker image
  3. - name: Build image and push to docker hub
  4. hosts: all
  5. tasks:
  6. - name: Get code from git repo
  7. include_role:
  8. name: common
  9. tasks_from: get-code-git
  10. - name: Install Docker Module for Python
  11. pip:
  12. name: docker
  13. - name: Log into DockerHub
  14. community.docker.docker_login:
  15. username: '{{ docker_username }}'
  16. password: '{{ docker_password }}'
  17. - name: Build an image and push it to a private repo
  18. community.docker.docker_image:
  19. build:
  20. path: ./joystream
  21. dockerfile: '{{ dockerfile }}'
  22. platform: '{{ platform }}'
  23. name: '{{ repository }}'
  24. tag: '{{ tag_name }}'
  25. push: yes
  26. source: build
  27. # Run in async fashion for max duration of 2 hours
  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. # Max number of times to check for status
  37. retries: 72
  38. # Check for the status every 100s
  39. delay: 100