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