Skip to content

Commit

Permalink
Merge pull request #3 from muskangupta042002/feature/NewChanges
Browse files Browse the repository at this point in the history
added logging while deploying to ec2
  • Loading branch information
muskangupta042002 authored Sep 10, 2023
2 parents 1b8a042 + 67e29e9 commit abf79ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/BuildAndTestSource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ jobs:
- name: Deploy to EC2
if: github.event.pull_request.merged == true
run: |
echo "Copying jar to EC2 Instance..."
scp -i "SpringKeyPair.pem" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${{ secrets.JAR_FILE }} ${{ secrets.DEV_INSTANCE_IP }}:${{ secrets.TARGET_DIR }}
echo "Jar Copied successfully!!!"
echo "Attempting logging to machine..."
# SSH into the EC2 instance and restart the application
ssh -i "SpringKeyPair.pem" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${{ secrets.DEV_INSTANCE_IP }} <<EOF
echo "Switching to application directory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class GreetingController {

@GetMapping("/greeting")
public String greeting(@RequestParam(name="name", required=false, defaultValue="World!!") String name, Model model) {
public String greeting(@RequestParam(name="name", required=false, defaultValue="World!") String name, Model model) {
model.addAttribute("name", name);
return "greeting";
}
Expand Down

0 comments on commit abf79ec

Please sign in to comment.