Skip to content

Commit 6f50a59

Browse files
committed
fixed src api folder
1 parent f076a2e commit 6f50a59

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

ansible/api-setup.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,22 @@
2424
args:
2525
executable: /bin/bash
2626

27+
- name: Ensure API code directory exists
28+
ansible.builtin.stat:
29+
path: /home/adminuser/ansible-setup/src/movie-analyst-api
30+
register: api_dir
31+
32+
- name: Fail if API code not found
33+
ansible.builtin.fail:
34+
msg: "API source code not found in /home/adminuser/ansible-setup/src/movie-analyst-api"
35+
when: not api_dir.stat.exists
36+
2737
- name: Install app dependencies
2838
shell: |
2939
export NVM_DIR="$HOME/.nvm"
3040
source "$NVM_DIR/nvm.sh"
31-
cd {{ app_path }}
41+
cd /home/adminuser/ansible-setup/src/movie-analyst-api
3242
npm install
3343
args:
3444
executable: /bin/bash
45+

ansible/deploy-api-from-local.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ scp -i "${SSH_KEY_LOCAL}" "${API_PLAYBOOK_LOCAL}" "${INVENTORY_LOCAL}" "${JUMP_U
2626

2727
# [2/4] Copiar código fuente de la API
2828
echo "[2/4] Copiando código fuente de la API..."
29-
scp -r -i "$SSH_KEY_LOCAL" ./src/movie-analyst-api "$JUMPBOX_USER@$JUMPBOX_HOST:/home/$JUMPBOX_USER/ansible-setup/src/"
29+
scp -i "$SSH_KEY_LOCAL" -r ./src/movie-analyst-api "$JUMPBOX_USER@$JUMPBOX_HOST:/home/$JUMPBOX_USER/ansible-setup/src/"
30+
3031

3132
# === STEP 2: Upload systemd template ===
3233
echo "[3/4] Uploading systemd template..."

0 commit comments

Comments
 (0)