blob: 0856c51618ddb611b27b2038fbb9959527f33697 [file] [log] [blame]
---
- name: configure ssh for nordix & opendev gerrit access
template: >
src=ssh_config.j2
dest=/home/ubuntu/.ssh/config
owner=ubuntu
group=ubuntu
mode=0644
- name: Update the system packages
apt:
update_cache: true
become: true
- name: Install jq package
apt:
name: jq
state: present
become: true
- name: Get current patchset commit hash
shell: git show --format='%H' --quiet
args:
chdir: "/home/ubuntu/src/gerrit.nordix.org/{{ GERRIT_PROJECT }}"
register: revision
- name: set GERRIT_PATCHSET_REVISION
set_fact:
GERRIT_PATCHSET_REVISION: "{{ revision.stdout }}"
- name: Get current branch name
shell: git branch --show-current
args:
chdir: "/home/ubuntu/src/gerrit.nordix.org/{{ GERRIT_PROJECT }}"
register: branch
- name: set GERRIT_BRANCH
set_fact:
GERRIT_BRANCH: "{{ branch.stdout }}"
- name: Get author email address
shell: git show --format='%ae' --quiet
args:
chdir: "/home/ubuntu/src/gerrit.nordix.org/{{ GERRIT_PROJECT }}"
register: email
- name: set GERRIT_EVENT_ACCOUNT_EMAIL
set_fact:
GERRIT_EVENT_ACCOUNT_EMAIL: "{{ email.stdout }}"
- name: Push upstream to opendev gerrit
script: push-upstream.sh "{{ GERRIT_PATCHSET_REVISION }}" "{{ GERRIT_PROJECT }}" "{{ GERRIT_BRANCH }}" "{{ GERRIT_EVENT_ACCOUNT_EMAIL }}"
args:
chdir: "/home/ubuntu/src/gerrit.nordix.org/{{ GERRIT_PROJECT }}"
executable: /bin/bash