Compare commits
5 commits
a21a21be9a
...
c1aad03c68
Author | SHA1 | Date | |
---|---|---|---|
c1aad03c68 | |||
ee1357194b | |||
7248db6bca | |||
6890791909 | |||
e1607151ee |
9 changed files with 22 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
|||
FILE="$(realpath "${BASH_SOURCE[0]}")"
|
||||
NAME="$(basename "${GITHUB_REPOSITORY}")"
|
||||
ROOT="$(dirname "${FILE}")"
|
||||
|
||||
KEY_ALGORITHM='ed25519'
|
||||
KEY_DIRECTORY='.ssh'
|
||||
KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}"
|
||||
|
@ -8,6 +12,15 @@ PACKAGES=(
|
|||
'tree'
|
||||
)
|
||||
SERVER="$(basename ${GITHUB_SERVER_URL})"
|
||||
TARGET='/usr/local/sbin'
|
||||
|
||||
# commands
|
||||
cd "${ROOT}/${NAME}" \
|
||||
|| exit
|
||||
for file in *.sh ; do
|
||||
cp "${file}" "${TARGET}" \
|
||||
|| exit
|
||||
done
|
||||
|
||||
# ssh
|
||||
cd \
|
||||
|
@ -24,4 +37,8 @@ echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \
|
|||
|| exit
|
||||
|
||||
# packages
|
||||
apt-get install --yes "${PACKAGES[@]}"
|
||||
apt-get install --yes "${PACKAGES[@]}" \
|
||||
|| exit
|
||||
|
||||
# remove
|
||||
rm --force --recursive "${ROOT}"
|
8
cd.sh
8
cd.sh
|
@ -5,7 +5,6 @@ PACKAGES=(
|
|||
'git'
|
||||
)
|
||||
REPOSITORY='rwx.work/cd'
|
||||
TARGET='/usr/local/sbin'
|
||||
|
||||
for nameserver in "${NAMESERVERS[@]}" ; do
|
||||
echo "nameserver ${nameserver}" \
|
||||
|
@ -19,9 +18,10 @@ apt-get update \
|
|||
apt-get install --yes "${PACKAGES[@]}" \
|
||||
|| exit
|
||||
|
||||
DIRECTORY="$(mktemp --directory)" \
|
||||
|| exit
|
||||
git clone \
|
||||
"${GITHUB_SERVER_URL}/${REPOSITORY}" \
|
||||
"${TARGET}" \
|
||||
"${DIRECTORY}" \
|
||||
|| exit
|
||||
|
||||
cd-bootstrap.sh
|
||||
"${DIRECTORY}/bootstrap.sh"
|
||||
|
|
Loading…
Add table
Reference in a new issue