From 0497f2b0b5ddbd23b2fe371f28807246536dd39b Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Fri, 10 Feb 2023 14:56:35 +0530 Subject: [PATCH 01/20] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 59bfdd8..af4b394 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const port2 = process.env.PORT2 || 3001; const server = http.createServer((req, res) => { res.statusCode = 200; - const msg = 'Hello Node!\n' + const msg = 'Hello Node nitin!\n' res.end(msg); }); @@ -20,4 +20,4 @@ server.listen(port, () => { server2.listen(port2, () => { console.log(`Server2 running on http://localhost:${port2}/`); -}) \ No newline at end of file +}) From 4cb71e5ad88e1a808d1cc24f69ec4b6a1d307d21 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Sun, 12 Feb 2023 00:21:53 +0530 Subject: [PATCH 02/20] Create test --- test | 1 + 1 file changed, 1 insertion(+) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test @@ -0,0 +1 @@ +test From 60016f053d8b8551246b9379b51fab857cf2b68d Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Sun, 12 Feb 2023 00:22:39 +0530 Subject: [PATCH 03/20] Update test --- test | 1 + 1 file changed, 1 insertion(+) diff --git a/test b/test index 9daeafb..83ce0af 100644 --- a/test +++ b/test @@ -1 +1,2 @@ test +12 From 6b44f1d25cd284f5c2621a2932128e78138b38eb Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Sun, 12 Feb 2023 01:40:33 +0530 Subject: [PATCH 04/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89308fe..c6d618d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Node Hello World +# Node Hello World - test Simple node.js app that servers "hello world" @@ -14,4 +14,4 @@ Great for testing simple deployments to the cloud ### Ports Used: `http://localhost:3000 -http://localhost:3001` \ No newline at end of file +http://localhost:3001` From be21346ac798fc1e9999eeb2feb925eecd23f5c8 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 13:45:52 +0530 Subject: [PATCH 05/20] Update test --- test | 1 + 1 file changed, 1 insertion(+) diff --git a/test b/test index 83ce0af..fdab2b2 100644 --- a/test +++ b/test @@ -1,2 +1,3 @@ test 12 +13 From 98cf89a4d8f441b1aca5686b680d7d2d93de5766 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:50:47 +0530 Subject: [PATCH 06/20] Add files via upload --- command-knolx.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 command-knolx.yml diff --git a/command-knolx.yml b/command-knolx.yml new file mode 100644 index 0000000..223c943 --- /dev/null +++ b/command-knolx.yml @@ -0,0 +1,18 @@ +--- +- hosts: localhost + tasks: + - name: Display the date + command: date + register: dateOutPut + ignore_errors: yes + - name: Display the contents of dateOutPut + debug: + msg: "{{dateOutPut}}" + - name: Display the std output of dateOutPut + debug: + msg: "{{dateOutPut.stdout}}" + - name: Display the std error of dateOutPut + debug: + msg: "{{dateOutPut.stderr}}" +... + From 956bb5e92446400d07ebd3c6d965cbfd30c3e23f Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:55:44 +0530 Subject: [PATCH 07/20] Update command-knolx.yml --- command-knolx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command-knolx.yml b/command-knolx.yml index 223c943..ba7fa62 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -1,5 +1,5 @@ --- -- hosts: localhost +- hosts: appServer tasks: - name: Display the date command: date From 89a316ffffa5b0791bcfa6bae09642bd0d6f3856 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:57:57 +0530 Subject: [PATCH 08/20] Update command-knolx.yml --- command-knolx.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command-knolx.yml b/command-knolx.yml index ba7fa62..169bf08 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -14,5 +14,7 @@ - name: Display the std error of dateOutPut debug: msg: "{{dateOutPut.stderr}}" + - name: Install Apache HTTP server + yum: name=httpd update_cache=yes state=latest ... From ed284e8bce058ca9c7d35511d6da93f7c120c7ac Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:00:02 +0530 Subject: [PATCH 09/20] Update command-knolx.yml --- command-knolx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/command-knolx.yml b/command-knolx.yml index 169bf08..a8b65ae 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -15,6 +15,7 @@ debug: msg: "{{dateOutPut.stderr}}" - name: Install Apache HTTP server + become: true yum: name=httpd update_cache=yes state=latest ... From fe1617de6eb9b809cd043f9fd5769ff2ba39432f Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:05:00 +0530 Subject: [PATCH 10/20] Update command-knolx.yml --- command-knolx.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/command-knolx.yml b/command-knolx.yml index a8b65ae..26c0984 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -13,9 +13,14 @@ msg: "{{dateOutPut.stdout}}" - name: Display the std error of dateOutPut debug: - msg: "{{dateOutPut.stderr}}" + msg: "{{dateOutPut.stderr}}" - name: Install Apache HTTP server - become: true yum: name=httpd update_cache=yes state=latest + - name: Start HTTP Server + service: name=httpd enabled=yes state=started + - name: Insert Index Page + template: + src: index.html + dest: /var/www/html/index.html ... From 5a80a56d49ad1df2b9d0e4c9ac3630ae6761db2b Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:05:51 +0530 Subject: [PATCH 11/20] Update command-knolx.yml --- command-knolx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/command-knolx.yml b/command-knolx.yml index 26c0984..b556be6 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -1,5 +1,6 @@ --- - hosts: appServer + become: true tasks: - name: Display the date command: date From bf95f9a5528bf6e5cada5983ed96e4080c6affcd Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:06:57 +0530 Subject: [PATCH 12/20] Update command-knolx.yml --- command-knolx.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/command-knolx.yml b/command-knolx.yml index b556be6..6ce210d 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -19,9 +19,5 @@ yum: name=httpd update_cache=yes state=latest - name: Start HTTP Server service: name=httpd enabled=yes state=started - - name: Insert Index Page - template: - src: index.html - dest: /var/www/html/index.html ... From cd96af7000a03889955484d21a32bfb5fc6a9d83 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:53:41 +0530 Subject: [PATCH 13/20] Update command-knolx.yml --- command-knolx.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command-knolx.yml b/command-knolx.yml index 6ce210d..c1950de 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -19,5 +19,14 @@ yum: name=httpd update_cache=yes state=latest - name: Start HTTP Server service: name=httpd enabled=yes state=started + - name: ensure nginx is at the latest version + apt: + name: nginx + state: latest + - name: start nginx + service: + name: nginx + state: started + enabled: yes # if you want to also enable nginx ... From 7446d0e5310d8b8849796dfaa22936c59598b258 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:54:39 +0530 Subject: [PATCH 14/20] Update command-knolx.yml --- command-knolx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command-knolx.yml b/command-knolx.yml index c1950de..db6fca7 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -20,7 +20,7 @@ - name: Start HTTP Server service: name=httpd enabled=yes state=started - name: ensure nginx is at the latest version - apt: + yum: name: nginx state: latest - name: start nginx From 96c1ccfef3a361defb9f1e7c6e5586c51ad0e6b7 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:56:21 +0530 Subject: [PATCH 15/20] Update command-knolx.yml --- command-knolx.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/command-knolx.yml b/command-knolx.yml index db6fca7..59fb237 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -15,18 +15,9 @@ - name: Display the std error of dateOutPut debug: msg: "{{dateOutPut.stderr}}" - - name: Install Apache HTTP server - yum: name=httpd update_cache=yes state=latest - - name: Start HTTP Server - service: name=httpd enabled=yes state=started - - name: ensure nginx is at the latest version - yum: - name: nginx - state: latest - - name: start nginx - service: - name: nginx - state: started - enabled: yes # if you want to also enable nginx + #- name: Install Apache HTTP server + # yum: name=httpd update_cache=yes state=latest + #- name: Start HTTP Server + # service: name=httpd enabled=yes state=started ... From 4f3af230d300748c17fdf548e3e47cef422f68dc Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Fri, 17 Feb 2023 13:58:57 +0530 Subject: [PATCH 16/20] Update command-knolx.yml --- command-knolx.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/command-knolx.yml b/command-knolx.yml index 59fb237..6ce210d 100644 --- a/command-knolx.yml +++ b/command-knolx.yml @@ -15,9 +15,9 @@ - name: Display the std error of dateOutPut debug: msg: "{{dateOutPut.stderr}}" - #- name: Install Apache HTTP server - # yum: name=httpd update_cache=yes state=latest - #- name: Start HTTP Server - # service: name=httpd enabled=yes state=started + - name: Install Apache HTTP server + yum: name=httpd update_cache=yes state=latest + - name: Start HTTP Server + service: name=httpd enabled=yes state=started ... From de1b71754a43baa4927e51e53d5340266b745714 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:51:44 +0530 Subject: [PATCH 17/20] Create node.js.yml --- .github/workflows/node.js.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..4e381fd --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,47 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Deploy SPA + +on: + pull_request: + branches: + - main + +jobs: + merge_to_master: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Merge to main + run: git merge --ff-only ${{ github.event.pull_request.head.ref }} + + deploy_to_dev: + needs: merge_to_master + runs-on: ubuntu-latest + steps: + - name: Install AWS CLI + uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ secrets.AWS_REGION }} + + - name: Deploy to Dev S3 bucket + run: echo "deploy to dev" + deploy_to_prod: + runs-on: ubuntu-latest + needs: deploy_to_dev + if: github.event_name == 'workflow_dispatch' + steps: + - name: Install AWS CLI + uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # aws-region: ${{ secrets.AWS_REGION }} + + - name: Deploy to Prod S3 bucket + run: echo "deploy to prod" From 1e9aa66726ce1b27b25c13a26895c6479d734cf7 Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:55:55 +0530 Subject: [PATCH 18/20] Update and rename node.js.yml to node.yml --- .github/workflows/{node.js.yml => node.yml} | 3 --- 1 file changed, 3 deletions(-) rename .github/workflows/{node.js.yml => node.yml} (93%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.yml similarity index 93% rename from .github/workflows/node.js.yml rename to .github/workflows/node.yml index 4e381fd..12c85ba 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.yml @@ -15,9 +15,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Merge to main - run: git merge --ff-only ${{ github.event.pull_request.head.ref }} - deploy_to_dev: needs: merge_to_master runs-on: ubuntu-latest From ff43280b5e9c35b5f171ab282c93a2e0bfca9ced Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:57:45 +0530 Subject: [PATCH 19/20] Update node.yml --- .github/workflows/node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 12c85ba..ea7c1cb 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install AWS CLI - uses: aws-actions/configure-aws-credentials@v1 + # uses: aws-actions/configure-aws-credentials@v1 # with: # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -34,7 +34,7 @@ jobs: if: github.event_name == 'workflow_dispatch' steps: - name: Install AWS CLI - uses: aws-actions/configure-aws-credentials@v1 + # uses: aws-actions/configure-aws-credentials@v1 # with: # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 11f8642dfb0345b4a9f1bc608d16542186be71ca Mon Sep 17 00:00:00 2001 From: Nitin Mishra <76727343+imnitin28@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:01:12 +0530 Subject: [PATCH 20/20] Create test1.txt --- test1.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test1.txt diff --git a/test1.txt b/test1.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test1.txt @@ -0,0 +1 @@ +test