-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto_deploy.py
More file actions
47 lines (31 loc) · 998 Bytes
/
Copy pathauto_deploy.py
File metadata and controls
47 lines (31 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from pexpect import pxssh
import getpass
import time
try:
s = pxssh.pxssh()
hostname = '74.207.252.20'
username = 'shareshop'
password = 'djangoproject'
s.login(hostname, username, password)
name = "share_shopping"
ACTOKEN = 'UTfyZCCs4f3H6TZQGjux'
s.sendline('find -delete')
s.prompt()
print(s.before)
s.sendline(f'git clone https://oauth2:{ACTOKEN}@gitlab.stud.idi.ntnu.no/programvareutvikling-v19/gruppe-3.git {name}')
s.prompt()
print(s.before)
s.sendline(f'cd {name}/share_shopping')
s.prompt()
print(s.before)
s.sendline('python3 -m pip install django')
s.prompt()
print(s.before)
# s.sendline('python3 manage.py runserver 0.0.0.0:8000')
# s.prompt()
# print(s.before)
s.logout()
except pxssh.ExceptionPxssh as e:
print("pxssh failed on login.")
print(e)
'https://oauth2:UTfyZCCs4f3H6TZQGjux@gitlab.stud.idi.ntnu.no/programvareutvikling-v19/gruppe-3.git'