Compare commits
2 commits
52a7cd1d44
...
d7d3aeee39
Author | SHA1 | Date | |
---|---|---|---|
d7d3aeee39 | |||
b7ab5a1f30 |
2 changed files with 20 additions and 17 deletions
20
cd-init
20
cd-init
|
@ -1,9 +1,3 @@
|
||||||
# packages
|
|
||||||
|
|
||||||
apt-get install --yes \
|
|
||||||
'rsync' \
|
|
||||||
'tree' \
|
|
||||||
|
|
||||||
# ssh
|
# ssh
|
||||||
|
|
||||||
mkdir --parents ~/.ssh
|
mkdir --parents ~/.ssh
|
||||||
|
@ -18,13 +12,9 @@ ssh-ed25519 \
|
||||||
AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5
|
AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5
|
||||||
" > ~/.ssh/known_hosts
|
" > ~/.ssh/known_hosts
|
||||||
|
|
||||||
# variables
|
# packages
|
||||||
|
|
||||||
export SSH_ID='cd'
|
apt-get install --yes \
|
||||||
|
'python3' \
|
||||||
export SSH_URL="\
|
'rsync' \
|
||||||
${SSH_ID}@$(basename ${GITHUB_SERVER_URL})\
|
'tree' \
|
||||||
:\
|
|
||||||
/${SSH_ID}/${GITHUB_REF_NAME}/${GITHUB_REPOSITORY}\
|
|
||||||
"
|
|
||||||
echo "${SSH_URL}"
|
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
|
[ "${1}" ] || exit
|
||||||
|
|
||||||
|
SYNC_HOST="$(basename ${GITHUB_SERVER_URL})"
|
||||||
|
SYNC_SOURCE="${1}"
|
||||||
|
SYNC_USER='cd'
|
||||||
|
|
||||||
|
SYNC_ROOT="/${SYNC_USER}/${GITHUB_REF_NAME}/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
|
SYNC_TARGET="${SYNC_USER}@${SYNC_HOST}:${SYNC_ROOT}"
|
||||||
|
if [ "${2}" ] ; then
|
||||||
|
SYNC_TARGET="${SYNC_TARGET}/${2}"
|
||||||
|
fi
|
||||||
|
|
||||||
#rsync \
|
#rsync \
|
||||||
#--archive \
|
#--archive \
|
||||||
#--delete-before \
|
#--delete-before \
|
||||||
#--verbose \
|
#--verbose \
|
||||||
#'out/' \
|
echo "${SYNC_SOURCE}/"
|
||||||
echo "${SSH_URL}/"
|
echo "${SYNC_TARGET}/"
|
||||||
|
|
Loading…
Reference in a new issue