Skip to content

Commit

Permalink
Updates dev_ci_cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
GSMgeeth authored Dec 16, 2024
1 parent 3dbfb5a commit 8b7aab8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/dev_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ jobs:
SERVER_IP: ${{ secrets.SERVER_IP }}
SERVER_USER: ${{ secrets.SERVER_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
PAYARA_ADMIN_PASS: ${{ secrets.PAYARA_ADMIN_PASS }}
run: |
# Add SSH private key to the SSH agent
echo "$SSH_PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem
# Variables
WAR_NAME="name.war"
WAR_NAME="hmis.war"
WAR_DIR="~/app/latest"
# Ensure deployment directory exists
Expand All @@ -88,8 +89,10 @@ jobs:
# Deploy the WAR using asadmin
ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "
/opt/payara5/bin/asadmin undeploy sethmademo || true
/opt/payara5/bin/asadmin deploy --force $WAR_DIR/$WAR_NAME
echo 'AS_ADMIN_PASSWORD=${{ secrets.PAYARA_ADMIN_PASS }}' > /tmp/payara-admin-pass.txt
/opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt undeploy sethmademo || true
/opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt deploy --force $WAR_DIR/$WAR_NAME
rm /tmp/payara-admin-pass.txt
"
# Validate if the application is running
Expand Down

0 comments on commit 8b7aab8

Please sign in to comment.