Skip to content

Commit

Permalink
fix: artifact script
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Mar 29, 2024
1 parent 55b994c commit 9f7f119
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,18 @@

## :whale: Docker 部署

### :books: docker-compose
### :books: 推荐使用 Docker Compose

1. change the args inside `docker-compose.yml`
```sh
mkdir shiro
cd shiro
wget https://github.com/raw/Innei/Shiro/main/docker-compose.yml
wget https://github.com/raw/Innei/Shiro/main/.env.template .env

2. run command
vim .env # 修改你的 ENV 变量
docker compose up -d

```bash
docker-compose up -d
```

### :package: docker run

```bash
docker build \
--build-arg BASE_URL=REPLACE_WITH_YOUR_BASE_URL \
--build-arg NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=REPLACE_WITH_YOUR_PUBLISHABLE_KEY \
--build-arg CLERK_SECRET_KEY=REPLACE_WITH_YOUR_SECRET_KEY \
-t shiro . --load
```

```bash
docker run --name shiro -d -p 2323:2323 shiro
docker compose pull # 后续更新镜像
```

## Markdown 扩展语法
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ version: '3'
services:
shiro:
container_name: shiro
build:
context: .
image: innei/shiro:latest
volumes:
- /app/.env:./.docker-env
- ./.env:/app/.env
restart: always
ports:
- 2323:2323
24 changes: 24 additions & 0 deletions scripts/download-latest-ci-build-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e

# 使用环境变量 GH_TOKEN
curl_response=$(curl -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
"https://github.com/gitapi/repos/innei/shiro/actions/artifacts?per_page=5&page=1")
download_url=$(echo $curl_response | jq -r '.artifacts[] | select(.name == "artifact") | .archive_download_url')

if [ -z "$download_url" ] || [ "$download_url" == "null" ]; then
echo "没有找到 URL 或发生了错误。"
exit 1
else
echo "找到的 URL: $download_url"
# 此处可以添加用于下载文件的命令,例如:
# curl -L "$download_url" -o desired_filename.zip
fi

# 使用环境变量 GH_TOKEN
curl -L -H "Authorization: Bearer $GH_TOKEN" "$download_url" -o build.zip

[ ! -d "shiro" ] && mkdir shiro
unzip build.zip
unzip -o release.zip 'standalone/*' -d shiro

0 comments on commit 9f7f119

Please sign in to comment.