Skip to content

Commit

Permalink
Release CI - Perf adjustments (#7641)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt authored Nov 15, 2020
1 parent 850a2d7 commit 3f40d8c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 16 deletions.
10 changes: 6 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#ignore all
# ignore all
**

#except src for build
# Except src for building
!./src/*
# TODO : Remove this line when Docker Buildkit works in Windows
!/.build/release/*

#ignore any App_Data folder
# Ignore any App_Data folder
**/App_Data/

#ignore all prebuild
# Ignore all prebuild
**/[b|B]in/
**/[O|o]bj/
12 changes: 10 additions & 2 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,20 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Deploy preview docker image for linux
if: matrix.os == 'ubuntu-latest'
# Buildkit Only working in linux
env:
DOCKER_BUILDKIT: 1
run: |
docker build -t orchardproject/orchardcore-cms-linux:dev .
rm -rf ./src/OrchardCore.Cms.Web/App_Data
dotnet publish -c Release -o ./.build/release --no-build --no-restore
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:dev .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-linux
- name: Deploy preview docker image for windows
if: matrix.os == 'windows-latest'
run: |
docker build -t orchardproject/orchardcore-cms-windows:dev .
Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data -Recurse | Remove-Item
dotnet publish -c Release -o ./.build/release --no-build --no-restore
docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-windows:dev .
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker push orchardproject/orchardcore-cms-windows
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Web App: Dotnet Publish (framework dependent)",
"program": "${workspaceRoot}/build/release/OrchardCore.Cms.Web.dll",
"program": "${workspaceRoot}/.build/release/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/build/release",
"cwd": "${workspaceRoot}/.build/release",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
Expand All @@ -91,9 +91,9 @@
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Web App: Dotnet Publish (self-contained)",
"program": "${workspaceRoot}/build/release/OrchardCore.Cms.Web.dll",
"program": "${workspaceRoot}/.build/release/OrchardCore.Cms.Web.dll",
"args": [],
"cwd": "${workspaceRoot}/build/release",
"cwd": "${workspaceRoot}/.build/release",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
Expand Down
12 changes: 6 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@
"windows":{
"command": "Remove-Item",
"args": [
"${workspaceRoot}\\build\\release\\*", "-recurse"
"${workspaceRoot}\\.build\\release\\*", "-recurse"
]
},
"args": [
"-rfv",
"${workspaceRoot}/build/release/*"
"${workspaceRoot}/.build/release/*"
]
},
{
Expand All @@ -100,15 +100,15 @@
"--configuration", "release",
"--runtime", "win-x64",
"--self-contained",
"--output", ".\\build\\release"
"--output", ".\\.build\\release"
]
},
"args": [
"publish", "${workspaceRoot}/src/OrchardCore.Cms.Web",
"--configuration", "release",
"--runtime", "linux-x64",
"--self-contained",
"--output", "./build/release"
"--output", "./.build/release"
],
"problemMatcher": "$msCompile"
},
Expand All @@ -123,15 +123,15 @@
"--configuration", "release",
"--runtime", "win-x64",
"--self-contained", "false",
"--output", ".\\build\\release"
"--output", ".\\.build\\release"
]
},
"args": [
"publish", "${workspaceRoot}/src/OrchardCore.Cms.Web",
"--configuration", "release",
"--runtime", "linux-x64",
"--self-contained", "false",
"--output", "./build/release"
"--output", "./.build/release"
],
"problemMatcher": "$msCompile"
},
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile-CI
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This Docker file is intended for the CI
# A prerequisite is a published application in the .build/release

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1

EXPOSE 80
ENV ASPNETCORE_URLS http://+:80
WORKDIR /app
COPY .build/release /app
ENTRYPOINT ["dotnet", "OrchardCore.Cms.Web.dll"]
7 changes: 7 additions & 0 deletions Dockerfile-CI.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Buildkit Only working in linux

# Ignore all
**

# Except precompiled files
!/.build/release/*

0 comments on commit 3f40d8c

Please sign in to comment.