Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dotnet-cicd-demo
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eoc-group
dotnet-cicd-demo
Commits
a11c9715
Commit
a11c9715
authored
Aug 14, 2025
by
shipengwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.aipark.com:eoc-group/dotnet-cicd-demo
parents
1af904f2
040af45b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
Dockerfile
Dockerfile
+30
-0
DotNetCicdDemo.sln
DotNetCicdDemo.sln
+1
-0
No files found.
.gitlab-ci.yml
View file @
a11c9715
# This file is a template, and might need editing before it works on your project.
# This file is a template, and might need editing before it works on your project.
# Official docker image.
# Official docker image.
variables
:
variables
:
CI_REGISTRY_USER
:
"
tcr
\\
$eoc"
CI_REGISTRY_IMAGE
:
k8s-t0.tencentcloudcr.com/eoc/dotnet-cicd-demo
CI_REGISTRY_IMAGE
:
k8s-t0.tencentcloudcr.com/eoc/dotnet-cicd-demo
CI_COMMIT_REF_SLUG
:
$(date +%Y%m%d%H%M)-${CI_COMMIT_SHORT_SHA}
CI_COMMIT_REF_SLUG
:
$(date +%Y%m%d%H%M)-${CI_COMMIT_SHORT_SHA}
...
@@ -11,7 +10,8 @@ services:
...
@@ -11,7 +10,8 @@ services:
-
docker:dind
-
docker:dind
before_script
:
before_script
:
-
echo User - $CI_REGISTRY_USER Password - $CI_REGISTRY_PASSWORD
-
echo >>> Image $CI_REGISTRY_IMAGE
-
echo >>> Version $CI_COMMIT_REF_SLUG
-
docker login -u 'tcr$eoc' -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker login -u 'tcr$eoc' -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build-master
:
build-master
:
...
...
Dockerfile
0 → 100644
View file @
a11c9715
# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
FROM
mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
USER
$APP_UID
WORKDIR
/app
EXPOSE
8080
# 此阶段用于生成服务项目
FROM
mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
ARG
BUILD_CONFIGURATION=Release
WORKDIR
/src
COPY
["DotNetCicdDemo/DotNetCicdDemo.csproj", "DotNetCicdDemo/"]
RUN
dotnet restore
"./DotNetCicdDemo/DotNetCicdDemo.csproj"
COPY
. .
WORKDIR
"/src/DotNetCicdDemo"
RUN
dotnet build
"./DotNetCicdDemo.csproj"
-c
$BUILD_CONFIGURATION
-o
/app/build
# 此阶段用于发布要复制到最终阶段的服务项目
FROM
build AS publish
ARG
BUILD_CONFIGURATION=Release
RUN
dotnet publish
"./DotNetCicdDemo.csproj"
-c
$BUILD_CONFIGURATION
-o
/app/publish /p:UseAppHost
=
false
# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
FROM
base AS final
WORKDIR
/app
COPY
--from=publish /app/publish .
ENTRYPOINT
["dotnet", "DotNetCicdDemo.dll"]
\ No newline at end of file
DotNetCicdDemo.sln
View file @
a11c9715
...
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决
...
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决
ProjectSection(SolutionItems) = preProject
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.gitignore = .gitignore
.gitlab-ci.yml = .gitlab-ci.yml
.gitlab-ci.yml = .gitlab-ci.yml
Dockerfile = Dockerfile
Git.md = Git.md
Git.md = Git.md
README.md = README.md
README.md = README.md
EndProjectSection
EndProjectSection
...
...
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