mirror of
https://github.com/cnrancher/kube-explorer.git
synced 2025-09-02 06:55:01 +00:00
Compare commits
4 Commits
v0.3.4-rc2
...
v0.4.0
Author | SHA1 | Date | |
---|---|---|---|
|
cd955243b6 | ||
|
2b39db9f07 | ||
|
4dc1acb1f2 | ||
|
989d087b99 |
410
.drone.yml
410
.drone.yml
@@ -1,309 +1,165 @@
|
||||
---
|
||||
type: docker
|
||||
kind: pipeline
|
||||
name: default-amd64
|
||||
name: push
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
pull: default
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- dapper ci
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
- name: release
|
||||
pull: default
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- dapper ci
|
||||
privileged: true
|
||||
environment:
|
||||
CROSS: 1
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: stage-binaries-head
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- "cp -r ./bin/kube-explorer ./package/"
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: stage-binaries
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- "cp -r ./bin/kube-explorer-linux-amd64 ./package/kube-explorer"
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: github_binary_release
|
||||
pull: default
|
||||
image: plugins/github-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: github_token
|
||||
checksum:
|
||||
- sha256
|
||||
files:
|
||||
- "bin/*"
|
||||
title: "${DRONE_TAG}"
|
||||
overwrite: true
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: docker-publish-head
|
||||
pull: default
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: package/Dockerfile
|
||||
context: package/
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: head-linux-amd64
|
||||
username:
|
||||
from_secret: docker_username
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: image-scan-head
|
||||
image: aquasec/trivy
|
||||
commands:
|
||||
- trivy image --no-progress --ignore-unfixed --severity HIGH,CRITICAL --scanners vuln --exit-code 1 cnrancher/kube-explorer:head-linux-amd64
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: docker-publish
|
||||
pull: default
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: package/Dockerfile
|
||||
context: package/
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: ${DRONE_TAG}-linux-amd64
|
||||
username:
|
||||
from_secret: docker_username
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
include:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
volumes:
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
node:
|
||||
instance: agent-amd64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
- "refs/tags/*"
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
name: default-arm64
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
pull: default
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- dapper ci
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
- "refs/tags/*"
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
- name: build
|
||||
image: rancher/dapper:v0.6.0
|
||||
commands:
|
||||
- dapper ci
|
||||
environment:
|
||||
CROSS: "${DRONE_BUILD_EVENT}"
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
|
||||
- name: stage-binaries
|
||||
image: rancher/dapper:v0.5.8
|
||||
commands:
|
||||
- "cp -r ./bin/* ./package/"
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
- "refs/tags/*"
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
- name: image-scan-head
|
||||
image: aquasec/trivy
|
||||
commands:
|
||||
- trivy image --no-progress --ignore-unfixed --severity HIGH,CRITICAL --scanners vuln --exit-code 1 cnrancher/kube-explorer:${DRONE_COMMIT:0:7}
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
|
||||
- name: docker-publish-head
|
||||
pull: default
|
||||
image: plugins/docker
|
||||
settings:
|
||||
build_args:
|
||||
- ARCH=arm64
|
||||
dockerfile: package/Dockerfile
|
||||
context: package/
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: head-linux-arm64
|
||||
username:
|
||||
from_secret: docker_username
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
- name: install-buildx-support
|
||||
image: tonistiigi/binfmt
|
||||
privileged: true
|
||||
entrypoint:
|
||||
- /usr/bin/binfmt
|
||||
command:
|
||||
- --install
|
||||
- all
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
|
||||
- name: docker-publish
|
||||
pull: default
|
||||
image: plugins/docker
|
||||
settings:
|
||||
build_args:
|
||||
- ARCH=arm64
|
||||
dockerfile: package/Dockerfile
|
||||
context: package/
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: ${DRONE_TAG}-linux-arm64
|
||||
username:
|
||||
from_secret: docker_username
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
volumes:
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
- "refs/tags/*"
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
|
||||
node:
|
||||
instance: agent-arm64
|
||||
- name: docker-publish
|
||||
image: thegeeklab/drone-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
platforms: linux/amd64,linux/arm64/v8
|
||||
dockerfile: package/Dockerfile
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: latest
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
|
||||
---
|
||||
type: docker
|
||||
kind: pipeline
|
||||
name: manifest
|
||||
name: tag
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: push-manifest-head
|
||||
image: plugins/manifest
|
||||
settings:
|
||||
ignore_missing: true
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
spec: manifest-head.tmpl
|
||||
when:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: push-manifest
|
||||
image: plugins/manifest
|
||||
settings:
|
||||
ignore_missing: true
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
spec: manifest.tmpl
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
include:
|
||||
- tag
|
||||
ref:
|
||||
include:
|
||||
- "refs/tags/*"
|
||||
|
||||
volumes:
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
node:
|
||||
instance: agent-amd64
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
include:
|
||||
- "refs/heads/main"
|
||||
- "refs/heads/v*"
|
||||
- "refs/tags/*"
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
steps:
|
||||
- name: release
|
||||
image: rancher/dapper:v0.6.0
|
||||
commands:
|
||||
- dapper ci
|
||||
privileged: true
|
||||
environment:
|
||||
CROSS: "${DRONE_BUILD_EVENT}"
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
|
||||
depends_on:
|
||||
- default-amd64
|
||||
- default-arm64
|
||||
- name: install-buildx-support
|
||||
image: tonistiigi/binfmt
|
||||
privileged: true
|
||||
entrypoint:
|
||||
- /usr/bin/binfmt
|
||||
command:
|
||||
- --install
|
||||
- all
|
||||
|
||||
...
|
||||
- name: docker-publish
|
||||
image: thegeeklab/drone-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
platforms: linux/amd64,linux/arm64/v8
|
||||
dockerfile: package/Dockerfile
|
||||
repo: cnrancher/kube-explorer
|
||||
tag: ${DRONE_TAG}
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
|
||||
- name: github_binary_release
|
||||
image: plugins/github-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: github_token
|
||||
checksum:
|
||||
- sha256
|
||||
files:
|
||||
- "bin/*"
|
||||
title: "${DRONE_TAG}"
|
||||
overwrite: true
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,3 +19,5 @@
|
||||
/dist
|
||||
/build
|
||||
*.swp
|
||||
|
||||
/.vscode
|
||||
|
@@ -9,7 +9,7 @@ ENV https_proxy=${PROXY} \
|
||||
RUN zypper -n install ca-certificates git-core wget curl unzip tar vim less file xz
|
||||
RUN zypper install -y -f docker
|
||||
|
||||
ENV UPX_VERSION 4.0.2
|
||||
ENV UPX_VERSION 4.2.1
|
||||
RUN curl -sL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${ARCH}_linux.tar.xz | tar xvJf - --strip-components=1 -C /tmp && \
|
||||
mv /tmp/upx /usr/bin/
|
||||
|
||||
@@ -17,10 +17,10 @@ RUN if [ "${ARCH}" == "amd64" ]; then \
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2; \
|
||||
fi
|
||||
|
||||
ENV GIT_COMMIT="b5d6adfbc855c3e0ef458e0aa0939c2582b8073f" \
|
||||
GIT_BRANCH="ke/v0.3" \
|
||||
ENV GIT_COMMIT="dafd3fc3b06454bb1b6a2cea68c561bb57482deb" \
|
||||
GIT_BRANCH="ke/v0.4" \
|
||||
GIT_SOURCE=${GOPATH}/src/github.com/rancher/steve \
|
||||
CATTLE_DASHBOARD_UI_VERSION="v2.7.5-kube-explorer-ui-rc7"
|
||||
CATTLE_DASHBOARD_UI_VERSION="v2.8.0-kube-explorer-ui-rc3"
|
||||
|
||||
ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS GOPROXY
|
||||
ENV DAPPER_SOURCE /opt/kube-explorer
|
||||
|
@@ -1,12 +0,0 @@
|
||||
image: cnrancher/kube-explorer:latest
|
||||
manifests:
|
||||
-
|
||||
image: cnrancher/kube-explorer:head-linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: cnrancher/kube-explorer:head-linux-arm64
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
@@ -1,12 +0,0 @@
|
||||
image: cnrancher/kube-explorer:{{build.tag}}
|
||||
manifests:
|
||||
-
|
||||
image: cnrancher/kube-explorer:{{build.tag}}-linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: cnrancher/kube-explorer:{{build.tag}}-linux-arm64
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
@@ -1,4 +1,7 @@
|
||||
FROM registry.suse.com/bci/bci-minimal:15.5
|
||||
|
||||
COPY kube-explorer entrypoint.sh /usr/bin/
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
ENV ARCH=${TARGETARCH:-"amd64"} OS=${TARGETOS:-"linux"}
|
||||
COPY package/entrypoint.sh /usr/bin/
|
||||
COPY bin/kube-explorer-${OS}-${ARCH} /usr/bin/kube-explorer
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
@@ -14,40 +14,53 @@ LD_INJECT_VALUES="-X github.com/rancher/steve/pkg/version.Version=$VERSION
|
||||
|
||||
pushd $GIT_SOURCE
|
||||
|
||||
if [ -n "$CROSS" ]; then
|
||||
for ARCH in ${OS_ARCH_ARG_LINUX}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-linux-$ARCH"
|
||||
echo "Building binary for linux/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=linux CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
case "$CROSS" in
|
||||
"push")
|
||||
for ARCH in ${OS_ARCH_ARG_LINUX}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-linux-$ARCH"
|
||||
echo "Building binary for linux/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=linux CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
;;
|
||||
"tag")
|
||||
for ARCH in ${OS_ARCH_ARG_LINUX}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-linux-$ARCH"
|
||||
echo "Building binary for linux/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=linux CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
|
||||
for ARCH in ${OS_ARCH_ARG_DARWIN}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-darwin-$ARCH"
|
||||
echo "Building binary for darwin/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=darwin CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
for ARCH in ${OS_ARCH_ARG_DARWIN}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-darwin-$ARCH"
|
||||
echo "Building binary for darwin/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=darwin CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
|
||||
for ARCH in ${OS_ARCH_ARG_WINDOWS}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-windows-$ARCH.exe"
|
||||
echo "Building binary for windows/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=windows CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
else
|
||||
# only build one for current platform
|
||||
CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o bin/kube-explorer
|
||||
fi
|
||||
for ARCH in ${OS_ARCH_ARG_WINDOWS}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-windows-$ARCH.exe"
|
||||
echo "Building binary for windows/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=windows CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
;;
|
||||
*)
|
||||
# only build one for current platform
|
||||
CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o "bin/kube-explorer-$(uname | tr '[:upper:]' '[:lower:]')-${ARCH}"
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir -p $DAPPER_SOURCE/bin
|
||||
|
||||
|
@@ -10,9 +10,8 @@ git reset --hard ${GIT_COMMIT}
|
||||
|
||||
mkdir -p pkg/ui/ui/dashboard
|
||||
cd pkg/ui/ui/dashboard
|
||||
curl -sL https://pandaria-dashboard-ui.s3.ap-southeast-2.amazonaws.com/release-2.7-cn/kube-explorer-ui/${CATTLE_DASHBOARD_UI_VERSION}.tar.gz | tar xvzf - --strip-components=2
|
||||
curl -sL https://pandaria-dashboard-ui.s3.ap-southeast-2.amazonaws.com/release-2.8-cn/kube-explorer-ui/${CATTLE_DASHBOARD_UI_VERSION}.tar.gz | tar xvzf - --strip-components=2
|
||||
cp index.html ../index.html
|
||||
|
||||
popd
|
||||
|
||||
$(dirname $0)/hack_fs $GIT_SOURCE/pkg/ui/ui/
|
||||
|
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
#
|
||||
# find . -type f -name "_*"
|
||||
#
|
||||
function hack_files() {
|
||||
for f in $(find $1 -type f -name "_*"); do
|
||||
name=$(basename $f)
|
||||
updir=$(dirname $f)
|
||||
new_path=$updir/${name:1}
|
||||
echo "move $f $new_path"
|
||||
mv $f $new_path
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
# find . -type d -name "_*"
|
||||
#
|
||||
function hack_dirs() {
|
||||
for d in $(find $1 -mindepth 1 -maxdepth 1 -type d); do
|
||||
if [[ ! -d $d ]]; then
|
||||
continue
|
||||
fi
|
||||
name=$(basename $d)
|
||||
if [[ ${name:0:1} == "_" ]]; then
|
||||
updir=$(dirname $d)
|
||||
new_path=$updir/${name:1}
|
||||
echo "move $d $new_path"
|
||||
mv $d $new_path
|
||||
hack_dirs $new_path
|
||||
continue
|
||||
fi
|
||||
hack_dirs $d
|
||||
done
|
||||
}
|
||||
|
||||
pushd $1
|
||||
hack_files .
|
||||
hack_dirs .
|
||||
popd
|
@@ -5,14 +5,6 @@ source $(dirname $0)/version
|
||||
|
||||
pushd $DAPPER_SOURCE
|
||||
|
||||
if [ -f bin/kube-explorer-linux-${ARCH} ]; then
|
||||
# For cross mode
|
||||
cp bin/kube-explorer-linux-${ARCH} package/kube-explorer
|
||||
else
|
||||
# For common mode
|
||||
cp bin/kube-explorer package/
|
||||
fi
|
||||
cd package
|
||||
docker build -f Dockerfile -t cnrancher/kube-explorer:$VERSION .
|
||||
docker build -f package/Dockerfile -t cnrancher/kube-explorer:$VERSION .
|
||||
|
||||
popd
|
||||
|
Submodule scripts/steve deleted from 26e14afc0b
Reference in New Issue
Block a user