-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature: support adb shell * fix(build): add kubectl into Dockerfile.kubectl --------- Co-authored-by: Qiu Jian <[email protected]> Co-authored-by: Zexi Li <[email protected]>
- Loading branch information
1 parent
9806dee
commit f3b9f25
Showing
12 changed files
with
167 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
FROM alpine:3.11 | ||
FROM alpine:3.19 | ||
|
||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
ARG TARGETARCH | ||
|
||
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositories | ||
RUN apk update && apk add kubectl && rm -rf /var/cache/apk/* | ||
RUN apk update && apk add curl android-tools && rm -rf /var/cache/apk/* | ||
RUN curl https://iso.yunion.cn/binaries/kubernetes-release/release/v1.22.9/bin/linux/${TARGETARCH}/kubectl -o /usr/bin/kubectl && chmod a+x /usr/bin/kubectl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
FROM registry.cn-beijing.aliyuncs.com/yunionio/webconsole-base:20230731.2 | ||
#FROM registry.cn-beijing.aliyuncs.com/yunionio/webconsole-base:20230731.2 | ||
FROM registry.cn-beijing.aliyuncs.com/yunionio/webconsole-base:20240514.0 | ||
|
||
ADD ./_output/alpine-build/bin/webconsole /opt/yunion/bin/webconsole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM registry.cn-beijing.aliyuncs.com/yunionio/kubectl:1.18.6 | ||
FROM registry.cn-beijing.aliyuncs.com/yunionio/kubectl:1.22.9 | ||
|
||
MAINTAINER "Zexi Li <[email protected]>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
build/notify/root/opt/yunion/share/local-templates/content@cn/BACKUP_PACK_COMPLETE.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
备份导出文件{{ .pack_file_name }}创建成功 |
1 change: 1 addition & 0 deletions
1
build/notify/root/opt/yunion/share/local-templates/content@en/BACKUP_PACK_COMPLETE.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Backup export file {{ .pack_file_name }} was created. |
1 change: 1 addition & 0 deletions
1
build/notify/root/opt/yunion/share/local-templates/title@cn/BACKUP_PACK_COMPLETE.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
备份导出文件{{ .pack_file_name }}创建成功 |
1 change: 1 addition & 0 deletions
1
build/notify/root/opt/yunion/share/local-templates/title@en/BACKUP_PACK_COMPLETE.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Backup export file {{ .pack_file_name }} was created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright 2019 Yunion | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package command | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
|
||
"yunion.io/x/pkg/errors" | ||
|
||
"yunion.io/x/onecloud/pkg/httperrors" | ||
"yunion.io/x/onecloud/pkg/mcclient" | ||
o "yunion.io/x/onecloud/pkg/webconsole/options" | ||
) | ||
|
||
type SAdbShellInfo struct { | ||
IpAddr string `json:"ip_addr"` | ||
Port int `json:"port"` | ||
} | ||
|
||
type SAdbShellCommand struct { | ||
*BaseCommand | ||
Info *SAdbShellInfo | ||
s *mcclient.ClientSession | ||
} | ||
|
||
func NewAdbShellCommand(info *SAdbShellInfo, s *mcclient.ClientSession) (*SAdbShellCommand, error) { | ||
if info.IpAddr == "" { | ||
return nil, errors.Wrap(httperrors.ErrInputParameter, "Empty host ip address") | ||
} | ||
if info.Port == 0 { | ||
return nil, errors.Wrap(httperrors.ErrInputParameter, "Empty host port") | ||
} | ||
name := o.Options.AdbPath | ||
cmd := NewBaseCommand(s, name, "-s", fmt.Sprintf("%s:%d", info.IpAddr, info.Port), "shell") | ||
tool := &SAdbShellCommand{ | ||
BaseCommand: cmd, | ||
Info: info, | ||
} | ||
initCmd := exec.Command(name, "connect", fmt.Sprintf("%s:%d", info.IpAddr, info.Port)) | ||
if err := initCmd.Run(); err != nil { | ||
return nil, errors.Wrap(err, "connect adb") | ||
} | ||
return tool, nil | ||
} | ||
|
||
func (c *SAdbShellCommand) GetCommand() *exec.Cmd { | ||
return c.BaseCommand.GetCommand() | ||
} | ||
|
||
func (c SAdbShellCommand) GetProtocol() string { | ||
return PROTOCOL_TTY | ||
} | ||
|
||
func (c *SAdbShellCommand) Cleanup() error { | ||
initCmd := exec.Command(o.Options.AdbPath, "disconnect", fmt.Sprintf("%s:%d", c.Info.IpAddr, c.Info.Port)) | ||
if err := initCmd.Run(); err != nil { | ||
return errors.Wrap(err, "disconnect adb") | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters