Commit 8cac0e79 by 李二毛

Merge branch 'development' into 'staging'

Development

See merge request liermao/microservice-autodevopspipelines!2
parents a08c8a83 f6876137
Pipeline #4060 passed with stage
in 20 seconds
......@@ -9,7 +9,7 @@ build_job:
- dotnet build MicroService.AutoDevOpsPipeLines.sln
- echo "build successful."
tags:
- local
- build
staging-major_job:
stage: staging-release-major
......@@ -19,7 +19,7 @@ staging-major_job:
- export K8sApiServer='https://172.24.83.222:6443'
# 001 Continuous integration image to registry.
- bash ./devops/PipeLines/CI.sh
- bash './devops/PipeLines/001 CI.sh'
# 002 Create config information to k8s's configmap.
- bash ./devops/PipeLines/Creation/CreateConfig.sh
......
......@@ -51,7 +51,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingB
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{26EA0840-FACE-4F72-B7D0-64CA9443BD9F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcExtensions", "src\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj", "{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcExtensions", "src\BuildingBlocks\Extensions\MvcExtensions\MvcExtensions.csproj", "{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -87,10 +87,10 @@ Global
{94C559A6-82AA-4149-9616-E6EC78753766}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94C559A6-82AA-4149-9616-E6EC78753766}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94C559A6-82AA-4149-9616-E6EC78753766}.Release|Any CPU.Build.0 = Release|Any CPU
{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739}.Release|Any CPU.Build.0 = Release|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -113,7 +113,7 @@ Global
{94C559A6-82AA-4149-9616-E6EC78753766} = {9F378944-D65E-4FA7-AA34-23BF342112F8}
{E53A0586-2FB1-4708-91A9-4D6814E02E3C} = {779A24FC-0621-4085-AB80-9BD0BB6AF605}
{26EA0840-FACE-4F72-B7D0-64CA9443BD9F} = {E53A0586-2FB1-4708-91A9-4D6814E02E3C}
{8E88AA1F-8D4F-4FA6-9B94-03203BB5F739} = {26EA0840-FACE-4F72-B7D0-64CA9443BD9F}
{2FFD7AC6-1A55-4B6E-BF9D-1B85CC5AE193} = {26EA0840-FACE-4F72-B7D0-64CA9443BD9F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94A499F2-8AA4-43FC-9824-F095E42D54AB}
......
#!/bin/bash
set -e
# Import external functions
chmod +x ./devops/PipeLines/functions.sh
./devops/PipeLines/functions.sh
GetAppName appName
echo "Continuous integration for ${appName} starting..."
declare solutionName=($(grep -oP '(?<=SolutionName>)[^<]+' "devops/app.props"))
dotnet build ${solutionName}
echo "Please check the version of each microservice carefully !!!"
declare major=($(grep -oP '(?<=VersionMajor>)[^<]+' "build/version.props"))
declare minor=($(grep -oP '(?<=VersionMinor>)[^<]+' "build/version.props"))
declare patch=($(grep -oP '(?<=VersionPatch>)[^<]+' "build/version.props"))
declare version=${major}.${minor}.${patch}
declare registryUserName=($(grep -oP '(?<=ImageUserName>)[^<]+' "build/deploy.props"))
declare publishOutputDir=./publish
rm -fr ${publishOutputDir}
mkdir -p ${publishOutputDir}
function CI()
{
declare publishable=$1
declare imagename=$2
echo ""
declare imagefullname=${RegistryHost}/${registryUserName}/${imagename}:${version}
declare publishFile=$3
echo "begin delivery of master branch for ${imagename}..."
mkdir -p ${publishOutputDir}/${imagename}
dotnet publish ${publishFile} -o ../../publish/${imagename} -c release --no-restore
docker build -t ${imagefullname} ${publishOutputDir}/${imagename}
docker push ${imagefullname}
rm -fr ${publishOutputDir}/${imagename}
echo "delivery of master branch for ${imagename}:${version} has been successful."
}
declare services=$(ls -l src/services | awk 'NR>1')
declare servicePrefix=""
declare serviceName=""
for service in ${services}
do
servicePrefix=($(echo ${service} | awk '{print $9}'))
isPublishable=($(grep -oP "(?<=${servicePrefix}Publishable>)[^<]+" "/tmp/cicd.props"))
GetServiceName "${servicePrefix}" serviceName
CI "${servicePrefix}" "./src/${servicePrefix}/${serviceName}.csproj"
done
echo ""
echo "Continuous integration for ${appName} has been successful."
\ No newline at end of file
{
"sdk": {
"version": "2.2.100"
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Mvc.Core">
<HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.core\2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Core.dll</HintPath>
</Reference>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Basket.API.dll"]
\ No newline at end of file
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Catalog.API.dll"]
\ No newline at end of file
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Identity.API.dll"]
\ No newline at end of file
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Marketing.API.dll"]
\ No newline at end of file
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Ordering.API.dll"]
\ No newline at end of file
FROM microsoft/dotnet:2.2.0-aspnetcore-runtime
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
MAINTAINER geekbuy.cn
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "Payment.API.dll"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment