This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f0412b4
Showing
13 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Get latest MCSM version (Daemon) | ||
|
||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
- name: Fetch release version | ||
run: | | ||
curl -sL https://api.github.com/repos/MCSManager/Daemon/releases/latest | \ | ||
jq -r ".tag_name" > release-versions/mcsm-daemon-version.txt | ||
- name: Check for modified files | ||
id: git-check | ||
run: (echo modified=$([ -z "`git status --porcelain`" ] >> $GITHUB_OUTPUT) && echo "false" || echo "true") | ||
- name: Commit latest release version | ||
if: steps.git-check.outputs.modified == 'true' | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email 'github-actions@users.noreply.github.com' | ||
git commit -am "chore: New release version (Daemon)" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Get latest MCSM version (Web) | ||
|
||
on: | ||
schedule: | ||
- cron: "0 2 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
- name: Fetch release version | ||
run: | | ||
curl -sL https://api.github.com/repos/MCSManager/MCSManager/releases/latest | \ | ||
jq -r ".tag_name" > release-versions/mcsm-version-web.txt | ||
- name: Check for modified files | ||
id: git-check | ||
run: (echo modified=$([ -z "`git status --porcelain`" ] >> $GITHUB_OUTPUT) && echo "false" || echo "true") | ||
- name: Commit latest release version | ||
if: steps.git-check.outputs.modified == 'true' | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email 'github-actions@users.noreply.github.com' | ||
git commit -am "chore: New release version (Web)" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Publish Docker Image (Daemon) | ||
|
||
on: | ||
push: | ||
paths: | ||
- "release-versions/mcsm-version-daemon.txt" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Check out" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: "Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Read Version file | ||
id: getversion | ||
run: echo "version=$(cat release-versions/mcsm-version.txt)" >> $GITHUB_OUTPUT | ||
|
||
- name: "Run build docker script" | ||
run: ./build-docker-daemon.sh ${{ steps.getversion.outputs.version }} | ||
|
||
- name: "Login to Docker Hub" | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: "Push image to Docker Hub" | ||
run: ./push-docker-daemon.sh ${{ steps.getversion.outputs.version }} ${{ secrets.DOCKERHUB_USERNAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and Publish Docker Image (Web) | ||
|
||
on: | ||
push: | ||
paths: | ||
- "release-versions/mcsm-version-web.txt" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Check out" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: "Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Read Version file | ||
id: getversion | ||
run: echo "version=$(cat release-versions/mcsm-version.txt)" >> $GITHUB_OUTPUT | ||
|
||
- name: "Run build docker script" | ||
run: ./build-docker-web.sh ${{ steps.getversion.outputs.version }} | ||
|
||
- name: "Login to Docker Hub" | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: "Push image to Docker Hub" | ||
run: ./push-docker-web.sh ${{ steps.getversion.outputs.version }} ${{ secrets.DOCKERHUB_USERNAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
desktop.ini | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:14-slim | ||
|
||
RUN apt update && apt install -y git | ||
RUN git clone https://github.com/MCSManager/MCSManager-Daemon-Production /opt/docker-mcsm/daemon | ||
RUN cd /opt/docker-mcsm/daemon && npm i --production | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
VOLUME [ "/var/run/docker.sock" ] | ||
|
||
EXPOSE 24444 | ||
|
||
WORKDIR /opt/docker-mcsm/daemon | ||
|
||
ENTRYPOINT [ "node", "app.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM node:14-alpine | ||
|
||
RUN apk --no-cache add git | ||
RUN git clone https://github.com/MCSManager/MCSManager-Web-Production /opt/docker-mcsm/web | ||
RUN cd /opt/docker-mcsm/web && npm i --production | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
EXPOSE 23333 | ||
|
||
WORKDIR /opt/docker-mcsm/web | ||
|
||
ENTRYPOINT [ "node", "app.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
VERSION="$1" | ||
VERSION="${VERSION#[vV]}" | ||
|
||
docker buildx build --load --platform linux/amd64 -t mcsmanager-daemon:${VERSION}-amd64 -f Dockerfile.daemon . | ||
docker buildx build --load --platform linux/arm64 -t mcsmanager-daemon:${VERSION}-arm64 -f Dockerfile.daemon . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
VERSION="$1" | ||
VERSION="${VERSION#[vV]}" | ||
|
||
docker buildx build --load --platform linux/amd64 -t mcsmanager-web:${VERSION}-amd64 -f Dockerfile.web . | ||
docker buildx build --load --platform linux/arm64 -t mcsmanager-web:${VERSION}-arm64 -f Dockerfile.web . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
VERSION="$1" | ||
VERSION="${VERSION#[vV]}" | ||
VERSION_MAJOR="${VERSION%%\.*}" | ||
VERSION_MINOR="${VERSION#*.}" | ||
VERSION_MINOR="${VERSION_MINOR%.*}" | ||
VERSION_PATCH="${VERSION##*.}" | ||
|
||
|
||
# Single Image | ||
docker image tag mcsmanager-daemon:${VERSION}-amd64 $2/mcsmanager-daemon:${VERSION}-amd64 | ||
docker image tag mcsmanager-daemon:${VERSION}-arm64 $2/mcsmanager-daemon:${VERSION}-arm64 | ||
docker image push --all-tags $2/mcsmanager-daemon | ||
|
||
# {MAJOR}.{MINOR}.{PATCH} Manifest | ||
docker manifest create $2/mcsmanager-daemon:${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} \ | ||
$2/mcsmanager-daemon:${VERSION}-amd64 \ | ||
$2/mcsmanager-daemon:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-daemon:${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} | ||
|
||
# {MAJOR}.{MINOR} Manifest | ||
docker manifest create $2/mcsmanager-daemon:${VERSION_MAJOR}.${VERSION_MINOR} \ | ||
$2/mcsmanager-daemon:${VERSION}-amd64 \ | ||
$2/mcsmanager-daemon:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-daemon:${VERSION_MAJOR}.${VERSION_MINOR} | ||
|
||
# {MAJOR} Manifest | ||
docker manifest create $2/mcsmanager-daemon:${VERSION_MAJOR} \ | ||
$2/mcsmanager-daemon:${VERSION}-amd64 \ | ||
$2/mcsmanager-daemon:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-daemon:${VERSION_MAJOR} | ||
|
||
# Latest Manifest | ||
docker manifest create --amend $2/mcsmanager-daemon:latest \ | ||
$2/mcsmanager-daemon:${VERSION}-amd64 \ | ||
$2/mcsmanager-daemon:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-daemon:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
VERSION="$1" | ||
VERSION="${VERSION#[vV]}" | ||
VERSION_MAJOR="${VERSION%%\.*}" | ||
VERSION_MINOR="${VERSION#*.}" | ||
VERSION_MINOR="${VERSION_MINOR%.*}" | ||
VERSION_PATCH="${VERSION##*.}" | ||
|
||
# Single Image | ||
docker image tag mcsmanager-web:${VERSION}-amd64 $2/mcsmanager-web:${VERSION}-amd64 | ||
docker image tag mcsmanager-web:${VERSION}-arm64 $2/mcsmanager-web:${VERSION}-arm64 | ||
docker image push --all-tags $2/mcsmanager-web | ||
|
||
# {MAJOR}.{MINOR}.{PATCH} Manifest | ||
docker manifest create $2/mcsmanager-web:${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} \ | ||
$2/mcsmanager-web:${VERSION}-amd64 \ | ||
$2/mcsmanager-web:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-web:${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} | ||
|
||
# {MAJOR}.{MINOR} Manifest | ||
docker manifest create $2/mcsmanager-web:${VERSION_MAJOR}.${VERSION_MINOR} \ | ||
$2/mcsmanager-web:${VERSION}-amd64 \ | ||
$2/mcsmanager-web:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-web:${VERSION_MAJOR}.${VERSION_MINOR} | ||
|
||
# {MAJOR} Manifest | ||
docker manifest create $2/mcsmanager-web:${VERSION_MAJOR} \ | ||
$2/mcsmanager-web:${VERSION}-amd64 \ | ||
$2/mcsmanager-web:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-web:${VERSION_MAJOR} | ||
|
||
# Latest Manifest | ||
docker manifest create --amend $2/mcsmanager-web:latest \ | ||
$2/mcsmanager-web:${VERSION}-amd64 \ | ||
$2/mcsmanager-web:${VERSION}-arm64 | ||
|
||
docker manifest push $2/mcsmanager-web:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v9.6.0 |