Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
microservice-autodevopspipelines
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李春生
microservice-autodevopspipelines
Commits
256bc38b
Commit
256bc38b
authored
Jan 11, 2019
by
据说甜蜜呢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化脚本
parent
2c531502
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
47 deletions
+19
-47
devops/PipeLines/Updating/003_CI.sh
+19
-47
No files found.
devops/PipeLines/Updating/003_CI.sh
View file @
256bc38b
...
...
@@ -3,8 +3,8 @@
set
-e
# Import external functions
chmod +x ./devops/PipeLines/
functions
.sh
./devops/PipeLines/functions
.sh
chmod +x ./devops/PipeLines/
Functions.deploy
.sh
source
./devops/PipeLines/Functions.deploy
.sh
GetAppName appName
echo
"Continuous integration for
${
appName
}
starting..."
...
...
@@ -15,54 +15,26 @@ then
echo
""
echo
"Tips: No services need to be cied."
else
declare
solutionName
=(
$(
grep
-oP
'(?<=SolutionName>)[^<]+'
"devops/app.props"
)
)
echo
""
echo
"
${
appName
}
building..."
GetSolutionName solutionName
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
""
if
[
"
${
publishable
}
"
==
"1"
]
;
then
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
}
echo
"delivery of master branch for
${
imagename
}
:
${
version
}
has been successful."
else
echo
"Tips: master branch for
${
imagename
}
:
${
version
}
will not be cied!!!"
fi
}
declare
services
=
$(
ls
-l
src/services | awk
'NR>1'
)
declare
servicePrefix
=
""
declare
serviceName
=
""
declare
isPublishable
=
"0"
for
service
in
${
services
}
GetRegistryHost RegistryHost
for
servicePrefix
in
`
ls
./src/Services|xargs
-d
'/'
`
do
servicePrefix
=(
$(
echo
${
service
}
| awk
'{print $9}'
)
)
isPublishable
=(
$(
grep
-oP
"(?<=
${
servicePrefix
}
Publishable>)[^<]+"
"/tmp/cicd.props"
)
)
GetServiceName
"
${
servicePrefix
}
"
serviceName
CI
${
isPublishable
}
"
${
servicePrefix
}
"
"./src/
${
servicePrefix
}
/
${
serviceName
}
.csproj"
IsPublishableOf
${
servicePrefix
}
isPublishable
GetServiceName
${
servicePrefix
}
serviceName
if
[
"
${
isPublishable
}
"
==
"1"
]
;
then
echo
""
echo
"Tips:
${
serviceName
}
begin integrating to image registry!!!"
GetServiceCsProjFile
${
servicePrefix
}
${
serviceName
}
serviceCsProjFile
CI
${
serviceName
}
${
serviceCsProjFile
}
else
echo
""
echo
"Tips:
${
serviceName
}
will not be integrated to image registry!!!"
fi
done
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment