Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Node Hello World
# Node Hello World - test

Simple node.js app that servers "hello world"

Expand All @@ -14,4 +14,4 @@ Great for testing simple deployments to the cloud

### Ports Used:
`http://localhost:3000
http://localhost:3001`
http://localhost:3001`
23 changes: 23 additions & 0 deletions command-knolx.yml
Original file line number Diff line number Diff line change
@@ -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
...

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -20,4 +20,4 @@ server.listen(port, () => {

server2.listen(port2, () => {
console.log(`Server2 running on http://localhost:${port2}/`);
})
})
3 changes: 3 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test
12
13
1 change: 1 addition & 0 deletions test1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test