Deploy From Github To Server
Deploy From Github To Server
inside interaction_prototype
2. forever stop 0
3. git pull
4. forever start index.js
5. exit
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
8 package(s) needed for security, out of 17 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-40-39 ~]$ ls
index.js node_modules package.json package-lock.json public
[ec2-user@ip-172-31-40-39 ~]$ forever list
info: Forever processes running
data: uid command script
forever pid id logfile uptime
data: [0] 0MIP /home/ec2-user/.nvm/versions/node/v13.5.0/bin/node index.js 4953
4964 /home/ec2-user/.forever/0MIP.log STOPPED
[ec2-user@ip-172-31-40-39 ~]$ forever stop 0MIP
error: Forever cannot find process with id: 0MIP
[ec2-user@ip-172-31-40-39 ~]$ forever stop 0
error: Forever cannot find process with id: 0
[ec2-user@ip-172-31-40-39 ~]$ forever stop index.js
error: Forever cannot find process with id: index.js
[ec2-user@ip-172-31-40-39 ~]$ forever list
info: No forever processes running
[ec2-user@ip-172-31-40-39 ~]$ forever index.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for
at least 1000ms
Server started on port 8000
***CREATING WEBSOCKET SERVER
***CREATED
events.js:282
throw er; // Unhandled 'error' event
^
^C
[ec2-user@ip-172-31-40-39 ~]$ top
top - 23:50:18 up 3 days, 2:28, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 85 total, 1 running, 48 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 491196 total, 108056 free, 115512 used, 267628 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 362868 avail Mem
Dependencies Resolved
===================================================================================
===================================================================================
====
Package Arch
Version Repository
Size
===================================================================================
===================================================================================
====
Installing:
git x86_64
2.23.1-0.amzn2.0.2 amzn2-core
135 k
Installing for dependencies:
emacs-filesystem noarch
1:25.3-3.amzn2.0.1 amzn2-core
64 k
git-core x86_64
2.23.1-0.amzn2.0.2 amzn2-core
5.0 M
git-core-doc noarch
2.23.1-0.amzn2.0.2 amzn2-core
2.4 M
libsecret x86_64
0.18.5-2.amzn2.0.2 amzn2-core
153 k
perl-Error noarch
1:0.17020-2.amzn2 amzn2-core
32 k
perl-Git noarch
2.23.1-0.amzn2.0.2 amzn2-core
47 k
perl-TermReadKey x86_64
2.30-20.amzn2.0.2 amzn2-core
31 k
Transaction Summary
===================================================================================
===================================================================================
====
Install 1 Package (+7 Dependent packages)
Installed:
git.x86_64 0:2.23.1-0.amzn2.0.2
Dependency Installed:
emacs-filesystem.noarch 1:25.3-3.amzn2.0.1 git-core.x86_64 0:2.23.1-0.amzn2.0.2
git-core-doc.noarch 0:2.23.1-0.amzn2.0.2 libsecret.x86_64 0:0.18.5-2.amzn2.0.2
perl-Error.noarch 1:0.17020-2.amzn2 perl-Git.noarch 0:2.23.1-0.amzn2.0.2
perl-TermReadKey.x86_64 0:2.30-20.amzn2.0.2
Complete!
[ec2-user@ip-172-31-40-39 ~]$ git clone https://github.com/oda-inc/oda-
experiments.git
Cloning into 'oda-experiments'...
Username for 'https://github.com': jhclaura
Password for 'https://jhclaura@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/oda-inc/oda-experiments.git/'
[ec2-user@ip-172-31-40-39 ~]$ ssh-keygen -t rsa -b 4096 -C "laura@oda.co"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ec2-user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ec2-user/.ssh/id_rsa.
Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:l0DX5YhmXABwButKzIICoSOdqTPK8hlbrYJ3KMaeDAY laura@oda.co
The key's randomart image is:
+---[RSA 4096]----+
|. oo=.oo... |
|.o o = o o.o |
|= + . . = . . |
|o+ o . + . |
|E . + . S o |
|=o o o . |
|=+..o . |
|B+==.. |
|o*+o. |
+----[SHA256]-----+
[ec2-user@ip-172-31-40-39 ~]$ cat /home/ec2-user/.ssh/id_rsa.pub
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAACAQDJzRk9/VShdPp+8vWKokk62hsLIWyBRKOBUG1MKZ2HUCcq7PJxEhF
7rBOKu301Q0QYTmSKLax5ajgcw6xgmcIgzp4pYgDrTI7/PLf65mnv1+o3+7sBmbh7rfvm71lylIiUthb6t+
fySuiMAbJb2p5he2HkCXMSjJKfFzxVGiO8/6dOCCVbfCrIdxZrXQuABwXDFGUppvvDYHIsLMFZhQM4D+/8W
sE5aYw3FnULUl8YfAKG20Vr9Ub1HNb06BqKNI5yoGop16S4JjsIhZMEj/4WgO7eMauexU0a+T1lXPjiiBDo
KNqvLwm0+4IySYiUe7Jm/M7Zc0kSP21xAHOZBhXb94AK8ZK5ZWmnDRlVQkKl5axNCOLPxzmJyHC1IQ5YMKO
ptbSuM1oFJk51pRfBoGW3MCKb2qi96dH+EWvzFrF0JXD2v4TNsagmSE1hO7jTSk6EHUnblXMQeQjC4lTXoR
BEuFU7/TxqtV1Jf4B8LDue+kcNYDDjsHpX6/ncLy6gE4OGMmukaEzSSQGWYpCxIN/jlOLLPRJ/jQqEWRY0i
qa79rKXVIAGB071YiDblN5BZgoS8WF90314yg+b51rDoU0d/rQ1zK0zJzjuIG8E8z/I7MAu2T6oiMYf7qc1
tZVa6ZeOmpVGorUmOH2d5LinzMAP8pPEkZCMn+Zk8/6tmjq14w== laura@oda.co
[ec2-user@ip-172-31-40-39 ~]$ ssh-add -K ~/.ssh/id_rsa
Could not open a connection to your authentication agent.
[ec2-user@ip-172-31-40-39 ~]$ ssh
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
[ec2-user@ip-172-31-40-39 ~]$ eval `ssh-agent -s`
Agent pid 17871
[ec2-user@ip-172-31-40-39 ~]$ ssh-add -K ~/.ssh/id_rsa
unknown option -- K
usage: ssh-add [options] [file ...]
Options:
-l List fingerprints of all identities.
-E hash Specify hash algorithm used for fingerprints.
-L List public key parameters of all identities.
-k Load only keys and not certificates.
-c Require confirmation to sign using identities
-t life Set lifetime (in seconds) when adding identities.
-d Delete identity.
-D Delete all identities.
-x Lock agent.
-X Unlock agent.
-s pkcs11 Add keys from PKCS#11 provider.
-e pkcs11 Remove keys provided by PKCS#11 provider.
[ec2-user@ip-172-31-40-39 ~]$ ssh-add ~/.ssh/id_rsa
Identity added: /home/ec2-user/.ssh/id_rsa (/home/ec2-user/.ssh/id_rsa)
[ec2-user@ip-172-31-40-39 ~]$ git clone git@github.com:oda-inc/oda-experiments.git
Cloning into 'oda-experiments'...
The authenticity of host 'github.com (140.82.114.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,140.82.114.3' (RSA) to the list of known
hosts.
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 32 (delta 1), reused 31 (delta 0), pack-reused 0
Receiving objects: 100% (32/32), 241.84 KiB | 6.36 MiB/s, done.
Resolving deltas: 100% (1/1), done.
[ec2-user@ip-172-31-40-39 ~]$ ls
oda-experiments
[ec2-user@ip-172-31-40-39 ~]$ cd oda-experiments/
[ec2-user@ip-172-31-40-39 oda-experiments]$ ls
interaction_prototype
[ec2-user@ip-172-31-40-39 oda-experiments]$ cd interaction_prototype/
[ec2-user@ip-172-31-40-39 interaction_prototype]$ ls
index.js package.json package-lock.json public
[ec2-user@ip-172-31-40-39 interaction_prototype]$ forever start index.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for
at least 1000ms
info: Forever processing file: index.js
[ec2-user@ip-172-31-40-39 interaction_prototype]$ forever list
info: Forever processes running
data: uid command script
forever pid id logfile uptime
data: [0] cJWm /home/ec2-user/.nvm/versions/node/v13.5.0/bin/node index.js 17901
17908 /home/ec2-user/.forever/cJWm.log STOPPED
[ec2-user@ip-172-31-40-39 interaction_prototype]$ node index.js
internal/modules/cjs/loader.js:969
throw err;
^