---

# this is from the "update-osmo-ci-on-slaves" jenkins job.  However,
# we need to initially install osmo-ci and the docker images *before*
# that jenkins job can execute subsequent updates

- name: install osmo-ci build dependencies
  apt:
    name:
      - make
    cache_valid_time: 3600
    update_cache: yes
    install_recommends: no

- name: deploy osmo-ci to home directory
  become: yes
  become_user: "{{ jenkins_user }}"
  git:
    repo: "https://gerrit.osmocom.org/osmo-ci"
    dest: "/home/{{ jenkins_user }}/osmo-ci"

- name: deploy osmo-gsm-manuals to home directory
  become: yes
  become_user: "{{ jenkins_user }}"
  git:
    repo: "https://gerrit.osmocom.org/osmo-gsm-manuals"
    dest: "/home/{{ jenkins_user }}/osmo-gsm-manuals"

- name: rebuild osmocom docker images for jenkins build tests
  become: yes
  become_user: "{{ jenkins_user }}"
  shell: ./scripts/osmo-ci-docker-rebuild.sh
  args:
    chdir: "/home/{{ jenkins_user }}/osmo-ci"
