Adding production build script
This commit is contained in:
parent
19529085e7
commit
a33404aeb8
45
build-production.sh
Normal file
45
build-production.sh
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#PREPARE
|
||||
echo "Setting Version"
|
||||
VERSION_NUMBER=$(date +%Y).$(date +%m).$(date +%d)
|
||||
echo "$VERSION_NUMBER"
|
||||
|
||||
#CREATE BRANCH
|
||||
echo "Creating Release Branch"
|
||||
git checkout -b release/"$VERSION_NUMBER"
|
||||
|
||||
#UPDATE PACKAGE FILE
|
||||
echo "Updating Angular App Version"
|
||||
cd source/ticketUI || exit
|
||||
jq '."version" = "'"$VERSION_NUMBER"'"' package.json > package."$VERSION_NUMBER".json
|
||||
mv package."$VERSION_NUMBER".json package.json
|
||||
|
||||
#BUILD API
|
||||
echo "Building API:" "$VERSION_NUMBER"
|
||||
cd source/ticketAPI || exit
|
||||
dotnet publish -c release -o artifacts /p:DebugType=None /p:DebugSymbols=false
|
||||
cd ..
|
||||
|
||||
#BUILD UI
|
||||
echo "Building UI:" "$VERSION_NUMBER"
|
||||
cd source/ticketUI || exit
|
||||
ng build --configuration=production
|
||||
cd ..
|
||||
|
||||
#PACKAGEING API
|
||||
echo "Creating Docker Container for API"
|
||||
cd source/ticketAPI || exit
|
||||
docker buildx create --name apibuilder-"$VERSION_NUMBER" --driver docker-container --bootstrap --use
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t terralilly85/follicle-api:"$VERSION_NUMBER" .
|
||||
cd ..
|
||||
|
||||
#PACKAGING UI
|
||||
echo "Creating Docker Container for UI"
|
||||
cd source/ticketUI || exit
|
||||
docker buildx create --name uibuilder-"$VERSION_NUMBER" --driver docker-container --bootstrap --use
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t terralilly85/follicle-ui:"$VERSION_NUMBER" .
|
||||
cd ..
|
||||
|
||||
#CLEAN UP ARTIFACTS
|
||||
echo "Cleaning up artifacts"
|
||||
rm -r source/ticketAPI/artifacts
|
||||
rm -r source/ticketUI/dist
|
||||
Loading…
Reference in New Issue
Block a user