From 3dfaf91350ac1a81662b3ad026eedfc302b0206e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 29 Mar 2024 19:45:04 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 40 ++++++++++++---------- Dockerfile | 64 ++--------------------------------- README.md | 5 +-- VERSION | 2 +- prepare.sh | 47 +++++++++++++++++++++++++ 5 files changed, 75 insertions(+), 83 deletions(-) create mode 100755 prepare.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fab58d3..abfec51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,21 +22,6 @@ jobs: version=$(cat VERSION) echo "version=${version}" >> $GITHUB_OUTPUT - - name: Create Tag - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git tag -a ${{ steps.get-version.outputs.version }} -m "Release Version ${{ steps.get-version.outputs.version }}" || echo "Tag already exists" - git push origin ${{ steps.get-version.outputs.version }} || echo "Tag already exists" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create Release - run: | - gh release create ${{ steps.get-version.outputs.version }} --notes "Release ${{ steps.get-version.outputs.version }}" || echo "Release already exists" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 @@ -53,6 +38,10 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Prepare files + run: | + bash prepare.sh + - name: Build and push uses: docker/build-push-action@v3 with: @@ -61,8 +50,23 @@ jobs: platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/mips64le push: true tags: | - jumpserver/web-static:${{ steps.get-version.outputs.version }}-bookworm - ghcr.io/jumpserver/web-static:${{ steps.get-version.outputs.version }}-bookworm + jumpserver/web-static:${{ steps.get-version.outputs.version }} + ghcr.io/jumpserver/web-static:${{ steps.get-version.outputs.version }} outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max + + - name: Create Tag + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git tag -a ${{ steps.get-version.outputs.version }} -m "Release Version ${{ steps.get-version.outputs.version }}" || echo "Tag already exists" + git push origin ${{ steps.get-version.outputs.version }} || echo "Tag already exists" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + run: | + gh release create ${{ steps.get-version.outputs.version }} --notes "Release ${{ steps.get-version.outputs.version }}" || echo "Release already exists" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 783065e..2ba08bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,63 +1,3 @@ -FROM debian:bookworm-slim +FROM scratch ARG TARGETARCH - -LABEL org.opencontainers.image.source https://github.com/jumpserver/web-static - -RUN set -ex \ - && apt-get update \ - && apt-get install -y --no-install-recommends wget ca-certificates \ - && echo "no" | dpkg-reconfigure dash \ - && rm -rf /var/lib/apt/lists/* - -ARG DOWNLOAD_URL=https://download.jumpserver.org -ARG PLAY_VERSION=1.1.0-1 - -WORKDIR /opt/player -RUN set -ex \ - && wget -q ${DOWNLOAD_URL}/public/glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz \ - && tar -xf glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz -C /opt/player --strip-components 1 \ - && rm -f glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz - -WORKDIR /opt/download/applets - -ARG PYTHON_VERSION=3.11.6 -RUN set -ex \ - && wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe - -ARG CHROME_VERSION=118.0.5993.118 -ARG CHROME_DRIVER_VERSION=118.0.5993.70 -RUN set -ex \ - && wget -q https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_DRIVER_VERSION}/chromedriver-win64.zip \ - && wget -q https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_VERSION}/chrome-win.zip - -ARG DBEAVER_VERSION=22.3.4 -RUN set -ex \ - && wget -q https://dbeaver.io/files/${DBEAVER_VERSION}/dbeaver-ce-${DBEAVER_VERSION}-x86_64-setup.exe \ - && wget -qO dbeaver-patch.msi ${DOWNLOAD_URL}/public/dbeaver-patch-${DBEAVER_VERSION}-x86_64-setup.msi - -ARG TINKER_VERSION=v0.1.5 -RUN set -ex \ - && wget -qO Tinker_Installer.exe ${DOWNLOAD_URL}/public/Tinker_Installer_${TINKER_VERSION}.exe - -WORKDIR /opt/download/public -ARG MRD_VERSION=10.6.7 -RUN set -ex \ - && wget -q ${DOWNLOAD_URL}/public/Microsoft_Remote_Desktop_${MRD_VERSION}_installer.pkg - -ARG VIDEO_PLAYER_VERSION=0.1.9 -RUN set -ex \ - && wget -qO JumpServer-Video-Player.dmg https://github.com/jumpserver/VideoPlayer/releases/download/v0.1.9/JumpServer.Video.Player-${VIDEO_PLAYER_VERSION}.dmg \ - && wget -qO JumpServer-Video-Player.exe https://github.com/jumpserver/VideoPlayer/releases/download/v0.1.9/JumpServer.Video.Player.Setup.${VIDEO_PLAYER_VERSION}.exe - -ARG OPENSSH_VERSION=v9.4.0.0 -RUN set -ex \ - && wget -qO OpenSSH-Win64.msi https://github.com/PowerShell/Win32-OpenSSH/releases/download/${OPENSSH_VERSION}p1-Beta/OpenSSH-Win64-${OPENSSH_VERSION}.msi - -ARG Client_VERSION=v2.1.2 -RUN set -ex \ - && wget -qO JumpServer-Client-Installer-x86_64.msi https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-win-${Client_VERSION}-x64.msi \ - && wget -qO JumpServer-Client-Installer-x86_64.exe https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-win-${Client_VERSION}-x64.exe \ - && wget -qO JumpServer-Client-Installer-amd64.dmg https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-mac-${Client_VERSION}-x64.dmg \ - && wget -qO JumpServer-Client-Installer-arm64.dmg https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-mac-${Client_VERSION}-arm64.dmg \ - && wget -qO JumpServer-Client-Installer-amd64.deb https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-linux-${Client_VERSION}-amd64.deb \ - && wget -qO JumpServer-Client-Installer-arm64.deb https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-linux-${Client_VERSION}-arm64.deb +COPY opt /opt \ No newline at end of file diff --git a/README.md b/README.md index cb89dbf..8425092 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ JumpServer Web 项目,包含一些静态安装包文件 ## Docker 构建 ```bash -VERSION=dev -docker buildx build --build-arg VERSION=${VERSION} -t jumpserver/web-static:${VERSION} . --load +VERSION=$(cat VERSION) +./prepare.sh +docker buildx build -t jumpserver/web-static:${VERSION} . --load ``` diff --git a/VERSION b/VERSION index e04e39c..992977a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.0.9 +v1.1.0 \ No newline at end of file diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..5031fe9 --- /dev/null +++ b/prepare.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -ex + +PLAY_VERSION=1.1.0-1 +PYTHON_VERSION=3.11.6 +CHROME_VERSION=118.0.5993.118 +CHROME_DRIVER_VERSION=118.0.5993.70 +DBEAVER_VERSION=22.3.4 +TINKER_VERSION=v0.1.5 +MRD_VERSION=10.6.7 +VIDEO_PLAYER_VERSION=0.1.9 +OPENSSH_VERSION=v9.4.0.0 +Client_VERSION=v2.1.2 + +DOWNLOAD_URL=https://download.jumpserver.org + +PROJECT_DIR=$(cd `dirname $0`; pwd) +cd ${PROJECT_DIR} || exit 1 + +mkdir -p ${PROJECT_DIR}/opt/player +cd ${PROJECT_DIR}/opt/player +wget -q ${DOWNLOAD_URL}/public/glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz +tar -xf glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz -C /opt/player --strip-components 1 +rm -f glyptodon-enterprise-player-${PLAY_VERSION}.tar.gz + +mkdir -p ${PROJECT_DIR}/opt/download/applets +cd ${PROJECT_DIR}/opt/download/applets +wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe +wget -q https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_DRIVER_VERSION}/chromedriver-win64.zip +wget -q https://github.com/jumpserver-dev/Chrome-Portable-Win64/releases/download/${CHROME_VERSION}/chrome-win.zip +wget -q https://dbeaver.io/files/${DBEAVER_VERSION}/dbeaver-ce-${DBEAVER_VERSION}-x86_64-setup.exe +wget -qO dbeaver-patch.msi ${DOWNLOAD_URL}/public/dbeaver-patch-${DBEAVER_VERSION}-x86_64-setup.msi +wget -qO Tinker_Installer.exe ${DOWNLOAD_URL}/public/Tinker_Installer_${TINKER_VERSION}.exe + +mkdir -p ${PROJECT_DIR}/opt/download/public +cd ${PROJECT_DIR}/opt/download/public +wget -q ${DOWNLOAD_URL}/public/Microsoft_Remote_Desktop_${MRD_VERSION}_installer.pkg +wget -qO JumpServer-Video-Player.dmg https://github.com/jumpserver/VideoPlayer/releases/download/v0.1.9/JumpServer.Video.Player-${VIDEO_PLAYER_VERSION}.dmg +wget -qO JumpServer-Video-Player.exe https://github.com/jumpserver/VideoPlayer/releases/download/v0.1.9/JumpServer.Video.Player.Setup.${VIDEO_PLAYER_VERSION}.exe +wget -qO OpenSSH-Win64.msi https://github.com/PowerShell/Win32-OpenSSH/releases/download/${OPENSSH_VERSION}p1-Beta/OpenSSH-Win64-${OPENSSH_VERSION}.msi +wget -qO JumpServer-Client-Installer-x86_64.msi https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-win-${Client_VERSION}-x64.msi +wget -qO JumpServer-Client-Installer-x86_64.exe https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-win-${Client_VERSION}-x64.exe +wget -qO JumpServer-Client-Installer-amd64.dmg https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-mac-${Client_VERSION}-x64.dmg +wget -qO JumpServer-Client-Installer-arm64.dmg https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-mac-${Client_VERSION}-arm64.dmg +wget -qO JumpServer-Client-Installer-amd64.deb https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-linux-${Client_VERSION}-amd64.deb +wget -qO JumpServer-Client-Installer-arm64.deb https://github.com/jumpserver/clients/releases/download/${Client_VERSION}/JumpServer-Client-Installer-linux-${Client_VERSION}-arm64.deb +