diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..ea7c1cb --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,44 @@ +# 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 + + 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" 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` diff --git a/command-knolx.yml b/command-knolx.yml new file mode 100644 index 0000000..6ce210d --- /dev/null +++ b/command-knolx.yml @@ -0,0 +1,23 @@ +--- +- hosts: appServer + become: true + 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}}" + - name: Install Apache HTTP server + yum: name=httpd update_cache=yes state=latest + - name: Start HTTP Server + service: name=httpd enabled=yes state=started +... + 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 +}) diff --git a/test b/test new file mode 100644 index 0000000..fdab2b2 --- /dev/null +++ b/test @@ -0,0 +1,3 @@ +test +12 +13 diff --git a/test1.txt b/test1.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test1.txt @@ -0,0 +1 @@ +test