Skip to content

Instantly share code, notes, and snippets.

@Anduin2017
Created April 16, 2022 20:45
Show Gist options
  • Save Anduin2017/51d456659a54c54b5047f2a0ed28c752 to your computer and use it in GitHub Desktop.
Save Anduin2017/51d456659a54c54b5047f2a0ed28c752 to your computer and use it in GitHub Desktop.
get_code()
{
folder="$1"
branch_name="$2"
cd $folder
git reset --hard HEAD
git clean . -fdx
git fetch
git checkout -b $branch_name origin/$branch_name
git checkout $branch_name
git reset --hard origin/$branch_name
cd ..
}
get_code "./Infrastructures" master
get_code "./Tracer" master
get_code "./Warp" master
get_code "./AiurDrive" master
get_code "./AiurUI" master
get_code "./Kahla" master
get_code "./Kahla.App" master
get_code "./Moonglade" release
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Warp/Aiursoft.Warp.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./AiurDrive/AiurDrive.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Tracer/Tracer.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./Infrastructures/Aiursoft.Infrastructures.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Infrastructures/Aiursoft.Infrastructures.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Infrastructures/Aiursoft.Infrastructures.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Infrastructures/Aiursoft.Infrastructures.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Infrastructures/Aiursoft.Infrastructures.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Kahla/Kahla.sln -c Release -r win-x64 --no-self-contained
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained ||\
dotnet publish ./Moonglade/src/Moonglade.sln -c Release -r win-x64 --no-self-contained
cd ./AiurUI
npm install
npm run build
cd ..
cd ./Kahla.App
npm install
npm run prod
cd ..
publish()
{
pool="$1"
sourcePath="$2"
stagingFolder="$pool-Staging"
tput setaf 2; echo "Copying binaries to staging folder..."; tput sgr0
mkdir -p /d/Apps/$stagingFolder
mv $sourcePath/* /d/Apps/$stagingFolder
cp /d/Apps/$pool/appsettings.Production.json /d/Apps/$stagingFolder/
cp /d/Apps/$pool/web.config /d/Apps/$stagingFolder/
tput setaf 2; echo "Stopping application pool: $pool..."; tput sgr0
/c/Windows/System32/inetsrv/appcmd stop apppool /apppool.name:$pool
tput setaf 2; echo "Switching $pool pool files to new folder"; tput sgr0
mkdir -p /d/Temp/
rm -rf /d/Temp/$pool
mv /d/Apps/$pool /d/Temp/$pool
mv /d/Apps/$stagingFolder/ /d/Apps/$pool
tput setaf 2; echo "Starting $pool..."; tput sgr0
/c/Windows/System32/inetsrv/appcmd start apppool /apppool.name:$pool
}
powershell "taskkill.exe /IM w3wp.exe /F"
publish Archon /d/Deployment/Infrastructures/src/WebServices/Basic/Archon/bin/Release/net6.0/win-x64/publish
publish Gateway /d/Deployment/Infrastructures/src/WebServices/Basic/Gateway/bin/Release/net6.0/win-x64/publish
publish Warpgate /d/Deployment/Infrastructures/src/WebServices/Infrastructure/Warpgate/bin/Release/net6.0/win-x64/publish
publish Observer /d/Deployment/Infrastructures/src/WebServices/Infrastructure/Observer/bin/Release/net6.0/win-x64/publish
publish Probe /d/Deployment/Infrastructures/src/WebServices/Infrastructure/Probe/bin/Release/net6.0/win-x64/publish
publish Stargate /d/Deployment/Infrastructures/src/WebServices/Infrastructure/Stargate/bin/Release/net6.0/win-x64/publish
publish Developer /d/Deployment/Infrastructures/src/WebServices/Basic/Developer/bin/Release/net6.0/win-x64/publish
publish WWW /d/Deployment/Infrastructures/src/WebServices/Business/WWW/bin/Release/net6.0/win-x64/publish
publish Account /d/Deployment/Infrastructures/src/WebServices/Business/Account/bin/Release/net6.0/win-x64/publish
publish Wiki /d/Deployment/Infrastructures/src/WebServices/Business/Wiki/bin/Release/net6.0/win-x64/publish
publish Status /d/Deployment/Infrastructures/src/WebServices/Business/Status/bin/Release/net6.0/win-x64/publish
publish Tracer /d/Deployment/Tracer/src/bin/Release/net6.0/win-x64/publish
publish Warp /d/Deployment/Warp/src/bin/Release/net6.0/win-x64/publish
publish AiurDrive /d/Deployment/AiurDrive/src/bin/Release/net6.0/win-x64/publish
publish KahlaHome /d/Deployment/Kahla/Kahla.Home/bin/Release/net6.0/win-x64/publish
publish KahlaServer /d/Deployment/Kahla/Kahla.Server/bin/Release/net6.0/win-x64/publish
publish AnduinBlog /d/Deployment/Moonglade/src/Moonglade.Web/bin/Release/net6.0/win-x64/publish
tput setaf 2; echo "Copying AiurUI..."; tput sgr0
cp -r ./AiurUI/ /d/apps/
tput setaf 2; echo "AiurUI finished publish!"; tput sgr0
tput setaf 2; echo "Copying Kahla.App..."; tput sgr0
cp -r ./Kahla.App/www/* /d/apps/KahlaApp
tput setaf 2; echo "KahlaApp finished publish! Triggering apps..."; tput sgr0
tput setaf 2; echo "Starting archon and gateway..."; tput sgr0
curl https://archon.aiursoft.com --output - > /dev/null
curl https://gateway.aiursoft.com --output - > /dev/null
tput setaf 2; echo "Starting basic infrastructure services..."; tput sgr0
curl https://warpgate.aiursoft.com --output - > /dev/null
curl https://stargate.aiursoft.com --output - > /dev/null
curl https://observer.aiursoft.com --output - > /dev/null
curl https://stargate.aiursoft.com --output - > /dev/null
tput setaf 2; echo "Starting basic business services..."; tput sgr0
curl https://www.aiursoft.com --output - > /dev/null
curl https://tracer.aiursoft.com --output - > /dev/null
curl https://warp.aiursoft.com --output - > /dev/null
curl https://drive.aiursoft.com --output - > /dev/null
tput setaf 2; echo "Starting Kahla services..."; tput sgr0
curl https://www.kahla.app --output - > /dev/null
curl https://server.kahla.app --output - > /dev/null
tput setaf 2; echo "Seeding Wiki..."; tput sgr0
curl https://wiki.aiursoft.com --output - > /dev/null
tput setaf 2; echo "Starting status..."; tput sgr0
curl https://status.aiursoft.com --output - > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment