diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 2ef4e53..35f0506 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -17,4 +17,15 @@ jobs: run: | for file in ${{ steps.changed-dockerfiles.outputs.all_changed_files }}; do echo "${file} changed." + resources/build.sh build ${file} done + - name: Notify-End + if: ${{ always() }} + run: | + echo "${{ github.repository }} 构建结束" > notify.tpl + echo "构建状态: ${{ job.status }}">> notify.tpl + echo "构建地址: https://gitea.amass.fun/${{ github.repository }}/actions/runs/${{ github.run_number }}">> notify.tpl + echo "仓库地址: https://gitea.amass.fun/${{ github.repository }}">> notify.tpl + echo "提交ID: $(git rev-parse --short HEAD)">> notify.tpl + echo -n "提交消息: ${{ github.event.head_commit.message }}">> notify.tpl + cat notify.tpl | envsubst | jq -sR . | xargs -0 -I {} curl -H "Content-Type: application/json" -X POST -d '{"type":"text","msg":{} }' https://amass.fun/notify diff --git a/resources/build.sh b/resources/build.sh new file mode 100644 index 0000000..45fcc8c --- /dev/null +++ b/resources/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +function build() { + local DOCKERFILE=$1 + echo "build $DOCKERFILE" +} + +function deploy(){ + +} + +function main() { + local cmd=$1 + shift 1 + case $cmd in + deploy) + deploy $@ + ;; + build) + build $@ + ;; + *) + build $@ + ;; + esac +} + +main $@ diff --git a/resources/notify.tpl b/resources/notify.tpl deleted file mode 100644 index 8b1397e..0000000 --- a/resources/notify.tpl +++ /dev/null @@ -1,6 +0,0 @@ -repo: $DRONE_REPO_NAME -status: $DRONE_BUILD_STATUS -commit: $DRONE_COMMIT -构建: $DRONE_BUILD_LINK -仓库: $DRONE_REPO_LINK -提交注释: $DRONE_COMMIT_MESSAGE \ No newline at end of file diff --git a/ubuntu2204.dockerfile b/ubuntu2204.dockerfile index c2e706b..a0743ca 100644 --- a/ubuntu2204.dockerfile +++ b/ubuntu2204.dockerfile @@ -1,12 +1,12 @@ FROM ubuntu:22.04 -LABEL maintainer 168062547@qq.com +LABEL maintainer="amass <168062547@qq.com>" ENV DEBIAN_FRONTEND=noninteractive RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list \ && sed -i "s@http://.*security.ubuntu.com@http://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list \ && apt update \ && apt install -y gcc g++ cmake ninja-build pkg-config openssh-server git nano gpg ca-certificates \ - wget curl rsync lsb-release ubuntu-keyring gnupg2 libssl-dev \ + wget curl rsync lsb-release ubuntu-keyring gnupg2 libssl-dev gettext jq \ && install -m 0755 -d /etc/apt/keyrings \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \ && chmod a+r /etc/apt/keyrings/docker.asc \ diff --git a/ubuntu2404.dockerfile b/ubuntu2404.dockerfile index 6d224bc..63e6839 100644 --- a/ubuntu2404.dockerfile +++ b/ubuntu2404.dockerfile @@ -1,7 +1,5 @@ FROM ubuntu:24.04 - LABEL maintainer="amass <168062547@qq.com>" - ENV DEBIAN_FRONTEND=noninteractive RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \