Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.api
Commits
6cc72e22
Commit
6cc72e22
authored
Dec 26, 2020
by
jinkaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加dockerignore缩减体积
parent
e9085a2d
Pipeline
#31267
passed with stage
in 13 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
.dockerignore
.dockerignore
+3
-0
ssh_tools.py
app/utils/ssh_tools.py
+5
-0
No files found.
.dockerignore
0 → 100644
View file @
6cc72e22
**/.git
**/.dockerignore
**/Dockerfile*
\ No newline at end of file
app/utils/ssh_tools.py
View file @
6cc72e22
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
import
paramiko
,
getpass
# getpass是隐藏密码
import
paramiko
,
getpass
# getpass是隐藏密码
from
paramiko
import
AuthenticationException
from
paramiko
import
AuthenticationException
from
app.application.application_service
import
ApplicationService
class
SSHConnect
():
class
SSHConnect
():
def
__init__
(
self
,
host_ip
,
host_port
,
user_name
,
password
):
def
__init__
(
self
,
host_ip
,
host_port
,
user_name
,
password
):
...
@@ -13,6 +15,9 @@ class SSHConnect():
...
@@ -13,6 +15,9 @@ class SSHConnect():
self
.
password
=
password
self
.
password
=
password
def
conncet
(
self
):
def
conncet
(
self
):
if
not
ApplicationService
()
.
test_connect_port
(
self
.
host_ip
,
self
.
host_port
):
raise
RuntimeError
(
f
'{self.host_ip}连不上,请检查'
)
try
:
try
:
# SSH远程连接
# SSH远程连接
self
.
ssh
=
paramiko
.
SSHClient
()
# 创建sshclient
self
.
ssh
=
paramiko
.
SSHClient
()
# 创建sshclient
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment