-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 User can compile it with docker now
- Loading branch information
Showing
5 changed files
with
110 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,25 @@ | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.idea | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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,19 @@ | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:6.0 | ||
WORKDIR /source | ||
ENV TZ=Asia/Shanghai | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
COPY . . | ||
RUN ls && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ | ||
sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \ | ||
apt update -y && \ | ||
apt install --yes --no-install-recommends \ | ||
wget \ | ||
gcc && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
wget -O ./amsat-all-frequencies.json https://cdn.jsdelivr.net/gh/palewire/amateur-satellite-database/data/amsat-all-frequencies.json && \ | ||
sed -i 's/@COMMIT_HASH@/DockerVersion/g' Properties/VERSION.cs && \ | ||
sed -i 's/@TAG_NAME@/DockerVersion/g' Properties/VERSION.cs && \ | ||
sed -i "s/@BUILD_TIME@/$(date)/g" Properties/VERSION.cs && \ | ||
chmod +x entrypoint.sh && mv entrypoint.sh / | ||
USER $APP_UID | ||
ENTRYPOINT ["/entrypoint.sh"] |
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
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,45 @@ | ||
#!/bin/bash | ||
echo "Start building..." | ||
cd /source | ||
mkdir builddist | ||
ARCH="--linux-x64" | ||
|
||
if [ ! -z "$1" ]; then | ||
ARCH="$1" | ||
fi | ||
|
||
if [[ "$ARCH" != "--linux-x64" && "$ARCH" != "--osx-x64" && "$ARCH" != "--win-x64" ]]; then | ||
echo "Invalid arg '$ARCH'; Only --linux-x64/--osx-x64/--win-x64 is allowed." | ||
exit 1 | ||
fi | ||
|
||
case "$ARCH" in | ||
--linux-x64) | ||
echo "Building for linux x64..." | ||
dotnet restore -r linux-x64 | ||
dotnet publish -c Release -r linux-x64 /p:PublishSingleFile=true --self-contained true | ||
mv /source/bin/Release/net6.0/linux-x64/publish/* builddist | ||
mv ./amsat-all-frequencies.json builddist | ||
;; | ||
--osx-x64) | ||
echo "Building for macos x64..." | ||
dotnet restore -r osx-x64 | ||
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-x64 -p:UseAppHost=true -property:Configuration=Release | ||
mv /source/bin/Release/net6.0/osx-x64/publish/SenhaixFreqWriter.app builddist | ||
cp Asset/shx8800-icons/icon.icns builddist/SenhaixFreqWriter.app/Contents/Resources | ||
mv ./amsat-all-frequencies.json builddist/SenhaixFreqWriter.app/Contents/MacOS | ||
;; | ||
--win-x64) | ||
echo "Building for windows x64..." | ||
dotnet restore -r win-x64 | ||
dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true /p:TargetOS=Windows --self-contained true | ||
mv /source/bin/Release/net6.0-windows10.0.19041.0/win-x64/publish/* builddist | ||
mv ./amsat-all-frequencies.json builddist | ||
;; | ||
*) | ||
echo "Invalid Args" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Done!" |
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