Skip to content

Commit

Permalink
feat: print logo and build commit hash when start.
Browse files Browse the repository at this point in the history
Signed-off-by: ShuangxueWu <qingchoulove@hotmail.com>
  • Loading branch information
qingchoulove committed Jan 12, 2024
1 parent 940d839 commit 551d84f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/kubespider-deploy-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Build images
run: |
set -x
docker buildx build --platform linux/arm64 -t cesign/kubespider:latest -f Dockerfile --load ./
docker buildx build --platform linux/amd64 -t cesign/kubespider:latest -f Dockerfile --load ./
docker buildx build --platform linux/arm64 --build-arg GIT_COMMIT=${GITHUB_SHA} -t cesign/kubespider:latest -f Dockerfile --load ./
docker buildx build --platform linux/amd64 --build-arg GIT_COMMIT=${GITHUB_SHA} -t cesign/kubespider:latest -f Dockerfile --load ./
cd downloaders/you-get
docker buildx build --platform linux/arm64 -t cesign/youget-downloader:latest -f Dockerfile --load ./
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Build images
run: |
set -x
docker buildx build --platform linux/amd64 -t registry.cn-hangzhou.aliyuncs.com/jwcesign/kubespider:latest -f Dockerfile --load ./
docker buildx build --platform linux/amd64 --build-arg GIT_COMMIT=${GITHUB_SHA} -t registry.cn-hangzhou.aliyuncs.com/jwcesign/kubespider:latest -f Dockerfile --load ./
cd downloaders/you-get
docker buildx build --platform linux/amd64 -t cesign/youget-downloader:latest -f Dockerfile --load ./
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/kubespider-latest-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
linux/arm64
push: true
tags: cesign/kubespider:latest
build-args: |
GIT_COMMIT=${GITHUB_SHA}
- name: youget-downloader - build and push
uses: docker/build-push-action@v3
Expand Down Expand Up @@ -110,6 +112,8 @@ jobs:
linux/amd64
push: true
tags: registry.cn-hangzhou.aliyuncs.com/jwcesign/kubespider:latest
build-args: |
GIT_COMMIT=${GITHUB_SHA}
- name: youget-downloader - build and push
uses: docker/build-push-action@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/kubespider-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
linux/arm64
push: true
tags: cesign/kubespider:${{ github.ref_name }}
build-args: |
GIT_COMMIT=${GITHUB_SHA}
acr-release-assests:
name: Release Kubespider
Expand Down Expand Up @@ -64,3 +66,5 @@ jobs:
linux/amd64
push: true
tags: registry.cn-hangzhou.aliyuncs.com/jwcesign/kubespider:${{ github.ref_name }}
build-args: |
GIT_COMMIT=${GITHUB_SHA}
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ FROM python:3.11-alpine

RUN touch /.dockerenv

# add git commit info
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT

WORKDIR /app
COPY ./kubespider ./kubespider
COPY ./.config ./.config_template
Expand Down
18 changes: 18 additions & 0 deletions kubespider/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import os

from core import runner

Expand All @@ -10,9 +11,26 @@ def check_python_version():
msg = f'Python version should be higher or equal to {min_version}.'
raise Exception(msg)


def print_logo():
print(r'''
_ _ _ _
| | ___ _| |__ ___ ___ _ __ (_) __| | ___ _ __
| |/ / | | | '_ \ / _ \/ __| '_ \| |/ _` |/ _ \ '__|
| <| |_| | |_) | __/\__ \ |_) | | (_| | __/ |
|_|\_\\__,_|_.__/ \___||___/ .__/|_|\__,_|\___|_|
|_|
''')
print('KubeSpider - A global resource download orchestration system')
if os.getenv('GIT_COMMIT'):
print('Build Tag: ' + os.getenv('GIT_COMMIT'))


def main():
runner.run_with_config_handler()


if __name__ == "__main__":
check_python_version()
print_logo()
main()

0 comments on commit 551d84f

Please sign in to comment.