chore: rsync instead of copy on deployments
This commit is contained in:
@@ -29,3 +29,5 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ${DEST_DIR}
|
||||
cp -r ./* ${DEST_DIR}
|
||||
|
||||
# TODO: maybe this is better: `rsync -av --delete ./ "${DEST_DIR}/"` # Sync everything perfectly, including hidden files, and delete old stale files
|
||||
@@ -19,7 +19,7 @@
|
||||
# env:
|
||||
# # commit tagged ? yes->prod : no->dev
|
||||
# AGEBD_ENV: ${{ github.ref_type == 'tag' && 'prod' || 'dev' }}
|
||||
# SVC_CURRRENT_DIR: /sls/bd/hla/${{ github.ref_type == 'tag' && 'prod' || 'dev' }}/services/master/current
|
||||
# SVC_CURRRENT_DIR: /sls/bd/hla/${{ github.ref_type == 'tag' && 'prod' || 'dev' }}/services/000-master/current
|
||||
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
@@ -30,7 +30,7 @@
|
||||
# - name: Copy files and replace {{ agebd_env }} with dev or prod
|
||||
# run: |
|
||||
# mkdir -p ${SVC_CURRRENT_DIR}
|
||||
# cp -r master/* ${SVC_CURRRENT_DIR}
|
||||
# cp -r 000-master/* ${SVC_CURRRENT_DIR}
|
||||
# sed -i 's/{{ agebd_env }}/${AGEBD_ENV}/g' ${SVC_CURRRENT_DIR}/systemd/AGEBD-SERVICE-MASTER.service
|
||||
|
||||
# - name: Create Python venv
|
||||
@@ -55,7 +55,7 @@
|
||||
# CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
|
||||
# set -e
|
||||
|
||||
# # 1. Parse changed directory names into space-separated string (e.g. "master secondary")
|
||||
# # 1. Parse changed directory names into space-separated string (e.g. "000-master 001-secondary")
|
||||
# CHANGED_SVC=$(echo "$CHANGED_FILES" | awk -F/ '$1=="services" {print $2}' | sort -u | xargs)
|
||||
|
||||
# echo "Detected changed services: '$CHANGED_SVC'"
|
||||
|
||||
@@ -30,3 +30,5 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ${DEST_DIR}
|
||||
cp -r ./* ${DEST_DIR}
|
||||
|
||||
# TODO: maybe this is better: `rsync -av --delete ./ "${DEST_DIR}/"` # Sync everything perfectly, including hidden files, and delete old stale files
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
# ansible.builtin.shell: |
|
||||
# mkdir -p "{{ svc_current_dir }}"
|
||||
|
||||
# TODO: make sure this is what we want (essentially wipes existing dest dir)
|
||||
- name: "[{{ target_service_name_lower }}] Sync service deployment files"
|
||||
ansible.builtin.copy:
|
||||
ansible.posix.synchronize:
|
||||
src: "{{ playbook_dir }}/../../../services/{{ target_service_name_lower }}/current/"
|
||||
dest: "{{ svc_current_dir }}/"
|
||||
mode: 'preserve'
|
||||
# ansible.builtin.shell: |
|
||||
# cp -r "{{ repo_root }}/services/{{ target_service_name_lower }}/current/" "{{ svc_current_dir }}"
|
||||
delete: yes # This removes stale files on the target that no longer exist locally
|
||||
recursive: yes
|
||||
|
||||
- name: "[{{ target_service_name_lower }}] Substitute environment variable inline"
|
||||
ansible.builtin.replace:
|
||||
|
||||
Reference in New Issue
Block a user