Added backend project
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
image: node:lts-alpine
|
||||
|
||||
stages:
|
||||
- install
|
||||
- lint
|
||||
- build
|
||||
- test
|
||||
- publish
|
||||
|
||||
install-mobile:
|
||||
stage: install
|
||||
image: node:lts-alpine
|
||||
before_script:
|
||||
- cd src/WorkTime.Mobile
|
||||
script:
|
||||
@@ -15,12 +15,13 @@ install-mobile:
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- package.json
|
||||
- src/WorkTime.Mobile/package.json
|
||||
paths:
|
||||
- node_modules
|
||||
- src/WorkTime.Mobile/node_modules
|
||||
|
||||
lint-mobile:
|
||||
stage: lint
|
||||
image: node:lts-alpine
|
||||
needs: ["install-mobile"]
|
||||
before_script:
|
||||
- cd src/WorkTime.Mobile
|
||||
@@ -29,13 +30,14 @@ lint-mobile:
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- package.json
|
||||
- src/WorkTime.Mobile/package.json
|
||||
paths:
|
||||
- node_modules
|
||||
- src/WorkTime.Mobile/node_modules
|
||||
policy: pull
|
||||
|
||||
build-mobile:
|
||||
stage: build
|
||||
image: node:lts-alpine
|
||||
needs: ["lint-mobile"]
|
||||
before_script:
|
||||
- cd src/WorkTime.Mobile
|
||||
@@ -43,16 +45,35 @@ build-mobile:
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- $CI_PROJECT_DIR/www
|
||||
- $CI_PROJECT_DIR/src/WorkTime.Mobile/www
|
||||
expire_in: 10 minutes
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- package.json
|
||||
- src/WorkTime.Mobile/package.json
|
||||
paths:
|
||||
- node_modules
|
||||
- src/WorkTime.Mobile/node_modules
|
||||
policy: pull
|
||||
|
||||
build-backend:
|
||||
stage: build
|
||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
||||
script:
|
||||
- dotnet restore
|
||||
- dotnet build --configuration Release --no-restore
|
||||
artifacts:
|
||||
paths:
|
||||
- "**/bin/Release"
|
||||
expire_in: 10 minutes
|
||||
|
||||
test-backend:
|
||||
stage: test
|
||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
||||
script:
|
||||
- dotnet test --verbosity normal
|
||||
dependencies:
|
||||
- build-backend
|
||||
|
||||
publish-mobile:
|
||||
stage: publish
|
||||
needs: ["build-mobile"]
|
||||
@@ -70,3 +91,15 @@ publish-mobile:
|
||||
- docker push registry.leon-hoppe.de/leon.hoppe/worktime:latest
|
||||
only:
|
||||
- tags
|
||||
|
||||
publish-backend:
|
||||
stage: publish
|
||||
script:
|
||||
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
|
||||
- dotnet pack -c Release -o . /p:Version=$VERSION
|
||||
- for nupkg in *.nupkg; do dotnet nuget push $nupkg -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json; done
|
||||
only:
|
||||
- tags
|
||||
dependencies:
|
||||
- build-backend
|
||||
- test-backend
|
||||
|
||||
Reference in New Issue
Block a user