ci tidyup more
This commit is contained in:
parent
09ca6bddf6
commit
041098ecde
2 changed files with 8 additions and 6 deletions
|
@ -3,6 +3,7 @@ from shlex import quote
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'users/build-ci/authorized_users',
|
'users/build-ci/authorized_users',
|
||||||
|
'sudoers/build-ci',
|
||||||
)
|
)
|
||||||
def ssh_keys(metadata):
|
def ssh_keys(metadata):
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -14,16 +14,17 @@ do
|
||||||
[[ $(jq -r '.repo' <<< $INTEGRATION) = $REPO_NAME ]] || continue
|
[[ $(jq -r '.repo' <<< $INTEGRATION) = $REPO_NAME ]] || continue
|
||||||
|
|
||||||
HOSTNAME=$(jq -r '.hostname' <<< $INTEGRATION)
|
HOSTNAME=$(jq -r '.hostname' <<< $INTEGRATION)
|
||||||
DESTINATION_PATH=$(jq -r '.path' <<< $INTEGRATION)
|
DEST_PATH=$(jq -r '.path' <<< $INTEGRATION)
|
||||||
DESTINATION_GROUP=$(jq -r '.group' <<< $INTEGRATION)
|
DEST_GROUP=$(jq -r '.group' <<< $INTEGRATION)
|
||||||
|
DEST_MODE=$(jq -r '.mode' <<< $INTEGRATION)
|
||||||
|
|
||||||
[[ -z "$HOSTNAME" ]] || [[ -z "$DESTINATION_PATH" ]] || [[ -z "$DESTINATION_GROUP" ]] && exit 5
|
[[ -z "$HOSTNAME" ]] || [[ -z "$DEST_PATH" ]] || [[ -z "$DEST_GROUP" ]] || [[ -z "$DEST_MODE" ]] && exit 5
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
rm -rf "$REPO_NAME"
|
rm -rf "$REPO_NAME"
|
||||||
git clone "$CLONE_URL" "$REPO_NAME"
|
git clone "$CLONE_URL" "$REPO_NAME"
|
||||||
|
|
||||||
ssh $SSH_OPTIONS "build-ci@$HOSTNAME" "find \"$DESTINATION_PATH\" -mindepth 1 -delete"
|
ssh $SSH_OPTIONS "build-ci@$HOSTNAME" "find \"$DEST_PATH\" -mindepth 1 -delete"
|
||||||
scp -r $SSH_OPTIONS "$REPO_NAME"/* "build-ci@$HOSTNAME:$DESTINATION_PATH"
|
scp -r $SSH_OPTIONS "$REPO_NAME"/* "build-ci@$HOSTNAME:$DEST_PATH"
|
||||||
ssh $SSH_OPTIONS "build-ci@$HOSTNAME" "sudo chown -R build-ci:$DESTINATION_GROUP $(printf "%q" "$DESTINATION_PATH")"
|
ssh $SSH_OPTIONS "build-ci@$HOSTNAME" "sudo chown -R build-ci:$DEST_GROUP $(printf "%q" "$DEST_PATH")"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue