Compare commits
No commits in common. "9e8dd694d91fe5709bffd53d3c5726e4e8f37c5c" and "2753d31ba6c7e56e4da656bfd8a1c7a46c615333" have entirely different histories.
9e8dd694d9
...
2753d31ba6
4 changed files with 24 additions and 21 deletions
|
@ -13,4 +13,4 @@ jobs:
|
||||||
- run: cd-clone-branch
|
- run: cd-clone-branch
|
||||||
- run: cd-build-project
|
- run: cd-build-project
|
||||||
- run: cd-browse-workspace
|
- run: cd-browse-workspace
|
||||||
- run: cd-synchronize
|
- run: cd-synchronize out
|
||||||
|
|
|
@ -55,24 +55,6 @@ def cd_list_environment():
|
||||||
print(variable, '=', value)
|
print(variable, '=', value)
|
||||||
|
|
||||||
|
|
||||||
def cd_synchronize():
|
|
||||||
sync_host = 'rwx.work'
|
|
||||||
sync_source = 'out'
|
|
||||||
sync_user = 'cd'
|
|
||||||
#
|
|
||||||
sync_root = f'/{sync_user}/{project.branch}/{project.name}'
|
|
||||||
#
|
|
||||||
sync_target = f'{sync_user}@{sync_host}:{sync_root}'
|
|
||||||
ps.run('rsync',
|
|
||||||
'--archive',
|
|
||||||
'--delete-before',
|
|
||||||
'--verbose',
|
|
||||||
f'{sync_source}/',
|
|
||||||
f'{sync_target}/',
|
|
||||||
'--dry-run',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def install_commands(path):
|
def install_commands(path):
|
||||||
user = '/usr/local/bin'
|
user = '/usr/local/bin'
|
||||||
for command in [
|
for command in [
|
||||||
|
@ -80,7 +62,6 @@ def install_commands(path):
|
||||||
'build-project',
|
'build-project',
|
||||||
'clone-branch',
|
'clone-branch',
|
||||||
'list-environment',
|
'list-environment',
|
||||||
'synchronize',
|
|
||||||
]:
|
]:
|
||||||
print(command)
|
print(command)
|
||||||
os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}'))
|
os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}'))
|
||||||
|
|
23
cmd/cd-synchronize.sh
Executable file
23
cmd/cd-synchronize.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
[ "${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 \
|
||||||
|
"${SYNC_SOURCE}/" \
|
||||||
|
"${SYNC_TARGET}/"
|
|
@ -69,7 +69,6 @@ from various CA, CI, OCI / OS.
|
||||||
|
|
||||||
* write bats
|
* write bats
|
||||||
|
|
||||||
* detect private key type
|
|
||||||
* handle git cloning credentials
|
* handle git cloning credentials
|
||||||
* reduce single conditions with &&
|
* reduce single conditions with &&
|
||||||
* write Python bootstrap process
|
* write Python bootstrap process
|
||||||
|
|
Loading…
Add table
Reference in a new issue