Update arthur-sync-qa-tools.yaml
Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: I64b79bdd47fde16a2dc9c52e022aa2bba1bfdf9a
diff --git a/arthur-sync-qa-tools.yaml b/arthur-sync-qa-tools.yaml
index f450023..813ac87 100644
--- a/arthur-sync-qa-tools.yaml
+++ b/arthur-sync-qa-tools.yaml
@@ -6,52 +6,52 @@
description: Sync qa-tools from arm Gitlab to TF Gerrit
disabled: false
parameters:
- - string:
- name: GERRIT_PROJECT
- default: 'https://review.trustedfirmware.org/sandbox/arthur/qa-tools'
- description: "Destination repository, default is qa-tools Gerrit project"
- - string:
- name: GITLAB_REPO
- default: 'https://gitlab.arm.com/tooling/qa-tools'
- description: "Source repository, default is qa-tools arm gitlab repo"
- - string:
- name: SYNC_BRANCH
- default: 'master'
- description: "The branch to sync"
+ - string:
+ name: GERRIT_PROJECT
+ default: 'https://review.trustedfirmware.org/sandbox/arthur/qa-tools'
+ description: "Destination repository, default is qa-tools Gerrit project"
+ - string:
+ name: GITLAB_REPO
+ default: 'https://gitlab.arm.com/tooling/qa-tools'
+ description: "Source repository, default is qa-tools arm gitlab repo"
+ - string:
+ name: SYNC_BRANCH
+ default: 'master'
+ description: "The branch to sync"
properties:
- - build-discarder:
- num-to-keep: 30
+ - build-discarder:
+ num-to-keep: 30
publishers:
- - email:
- recipients: 'arthur.she@linaro.org'
-# triggers:
+ - email:
+ recipients: 'arthur.she@linaro.org'
+# triggers:
# - timed: '59 23 * * 7'
wrappers:
- - credentials-binding:
- - ssh-user-private-key:
- credential-id: TFA_CI_BOT_USER_SSH_KEY
- key-file-variable: CI_BOT_KEY
- username-variable: CI_BOT_USERNAME
- passphrase-variable: ''
- - workspace-cleanup
- - timestamps
+ - workspace-cleanup
+ - timestamps
+ - credentials-binding:
+ - ssh-user-private-key:
+ credential-id: TFA_CI_BOT_USER_SSH_KEY
+ key-file-variable: CI_BOT_KEY
+ username-variable: CI_BOT_USERNAME
+ passphrase-variable: ''
builders:
- - shell: |-
- #!/bin/bash
+ - shell: |-
+ #!/bin/bash
- SSH_PARAMS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAcceptedKeyTypes=+ssh-rsa -p 29418 -i ${CI_BOT_KEY}"
- host=${GERRIT_PROJECT#*://}
- GERRIT_HOST=${host%%/*}
- REPO_PROJECT=${host#*/}
- REPO_SSH_URL="ssh://${CI_BOT_USERNAME}@${GERRIT_HOST}:29418/${REPO_PROJECT}"
+ SSH_PARAMS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PubkeyAcceptedKeyTypes=+ssh-rsa -p 29418 -i ${CI_BOT_KEY}"
+ host=${GERRIT_PROJECT#*://}
+ GERRIT_HOST=${host%%/*}
+ REPO_PROJECT=${host#*/}
+ REPO_SSH_URL="ssh://${CI_BOT_USERNAME}@${GERRIT_HOST}:29418/${REPO_PROJECT}"
- _workdir=$(mktemp -d)
- trap '[ -d "${_workdir}" ] && rm -rf "${_workdir}"' EXIT
+ _workdir=$(mktemp -d)
+ trap '[ -d "${_workdir}" ] && rm -rf "${_workdir}"' EXIT
- git -C "${_workdir}" init > /dev/null 2>&1
+ git -C "${_workdir}" init > /dev/null 2>&1
- echo "Fetch ${GITLAB_REPO}:${SYNC_BRANCH}"
- git -C "${_workdir}" fetch ${GITLAB_REPO} ${SYNC_BRANCH}
- echo "Sync to ${GERRIT_PROJECT}"
- GIT_SSH_COMMAND="ssh ${SSH_PARAMS}" git -C "${_workdir}" push ${REPO_SSH_URL} ${SYNC_BRANCH}
+ echo "Fetch ${GITLAB_REPO}:${SYNC_BRANCH}"
+ git -C "${_workdir}" fetch ${GITLAB_REPO} ${SYNC_BRANCH}
+ echo "Sync to ${GERRIT_PROJECT}"
+ GIT_SSH_COMMAND="ssh ${SSH_PARAMS}" git -C "${_workdir}" push ${REPO_SSH_URL} ${SYNC_BRANCH}