build and release scripts

master
Tudor Stanciu 2021-11-12 19:12:40 +02:00
parent 23025e1856
commit 2cb896b08c
3 changed files with 53 additions and 2 deletions

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.30717.126 VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5A8FF505-3E4D-4258-BC3E-CACD74A7B98C}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5A8FF505-3E4D-4258-BC3E-CACD74A7B98C}"
EndProject EndProject
@ -30,6 +30,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer.PublishedLan
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer.Wrapper", "IdentityServer.Wrapper\IdentityServer.Wrapper.csproj", "{F6FEC33B-C79E-4484-B356-9C7F1A5E5D95}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer.Wrapper", "IdentityServer.Wrapper\IdentityServer.Wrapper.csproj", "{F6FEC33B-C79E-4484-B356-9C7F1A5E5D95}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{5A9268B6-F73B-4773-86BF-45DFF7EF75F7}"
ProjectSection(SolutionItems) = preProject
build-amd64.sh = build-amd64.sh
release.sh = release.sh
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -71,6 +77,7 @@ Global
{CE81A435-49AC-4544-A381-FAC91BEB3C49} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C} {CE81A435-49AC-4544-A381-FAC91BEB3C49} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C}
{67B4D1FF-D02E-4DA6-9FB8-F71667360448} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C} {67B4D1FF-D02E-4DA6-9FB8-F71667360448} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C}
{F6FEC33B-C79E-4484-B356-9C7F1A5E5D95} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C} {F6FEC33B-C79E-4484-B356-9C7F1A5E5D95} = {5A8FF505-3E4D-4258-BC3E-CACD74A7B98C}
{5A9268B6-F73B-4773-86BF-45DFF7EF75F7} = {0B8B6E9B-0200-47EC-91D9-BEDF4BFC248F}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E93DC46D-9C55-4A05-B299-497CDD90747E} SolutionGuid = {E93DC46D-9C55-4A05-B299-497CDD90747E}

22
build-amd64.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
echo "Welcome!"
version="1.0.0"
localRegistryPass="***REMOVED***"
echo "Create docker image with version $version."
docker image build -t "identity-server:$version" -f "IdentityServer.Api/Dockerfile" .
echo "Tag docker image with registry prefix."
docker tag identity-server:$version alpine-nexus:8500/identity/identity-server:$version
echo "Login to alpine-nexus registry."
docker login --username=admin --password=$localRegistryPass alpine-nexus:8500
echo "Push image alpine-nexus:8500/identity/identity-server:$version to registry."
docker push alpine-nexus:8500/identity/identity-server:$version
echo "Remove image alpine-nexus:8500/identity/identity-server:$version from local machine."
docker rmi alpine-nexus:8500/identity/identity-server:$version
echo "DONE!"

22
release.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
echo "Welcome!"
version="1.0.0"
oldver="1.0.0"
echo "Pull docker image identity-server:$version from registry."
docker pull alpine-nexus:8500/identity/identity-server:$version
echo "Stop old container."
docker stop identity-server && docker rm identity-server
echo "Run new container."
docker run -d --name identity-server --restart=always -p 5011:80 alpine-nexus:8500/identity/identity-server:$version
echo "Remove old image identity-server:$oldver."
docker rmi alpine-nexus:8500/identity/identity-server:$oldver
echo "Get container logs:"
docker logs identity-server
echo "DONE!"