Skip to content

Commit

Permalink
Merge branch 'master' of github.com:naiba/nezha
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Jul 12, 2021
2 parents 42b6768 + 2ecd6c5 commit 32cb05e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,40 @@ jobs:
run: |
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
echo "${{ secrets.ALI_PAT }}" | docker login registry.cn-shanghai.aliyuncs.com -u ${{ secrets.ALI_USER }} --password-stdin
- name: Build dasbboard image
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Code Test
run: |
go env
go test -v ./...
docker build -t nezha-dasbboard -f Dockerfile .
- name: Push dasbboard image
go test -v ./...
- name: Set up image name
run: |
GHRC_IMAGE_NAME=$(echo "ghcr.io/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
if [ ${{ github.repository_owner }} = "naiba" ]
then ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/naibahq/nezha-dashboard")
else ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
then ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/naibahq/nezha-dashboard")
else ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
fi
docker tag nezha-dasbboard $GHRC_IMAGE_NAME
docker tag nezha-dasbboard $ALI_IMAGE_NAME
docker push $GHRC_IMAGE_NAME
docker push $ALI_IMAGE_NAME
echo "::set-output name=GHRC_IMAGE_NAME::$GHRC_IMAGE_NAME"
echo "::set-output name=ALI_IMAGE_NAME::$ALI_IMAGE_NAME"
id: image-name

- name: Build dasbboard image And Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm,linux/386
push: true
tags: |
${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}
${{ steps.image-name.outputs.ALI_IMAGE_NAME }}
- name: Purge jsdelivr cache
run: |
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/install.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img width="500" style="max-width:100%" src="resource/static/brand.png" title="哪吒监控">
<br><br>
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.8.6&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.6.3-brightgreen?style=for-the-badge&logo=linux">
<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Dashboard%20image?label=Dash%20v0.8.6&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/workflow/status/naiba/nezha/Agent%20release?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.6.4-brightgreen?style=for-the-badge&logo=linux">
<br>
<br>
<p>:trollface: <b>哪吒监控</b> 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。</p>
Expand Down
7 changes: 1 addition & 6 deletions script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha"
NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent"
NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service"
NZ_VERSION="v0.6.3"
NZ_VERSION="v0.6.4"

red='\033[0;31m'
green='\033[0;32m'
Expand Down Expand Up @@ -134,11 +134,6 @@ install_dashboard() {

echo -e "> 安装面板"

if [[ $(uname -m | grep 'arm\|aarch') != "" ]]; then
echo "面板目前不支持在 arm 环境下安装"
exit 1
fi

# 哪吒监控文件夹
mkdir -p $NZ_DASHBOARD_PATH
chmod 777 -R $NZ_DASHBOARD_PATH
Expand Down

0 comments on commit 32cb05e

Please sign in to comment.