-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
86 lines (85 loc) · 3.95 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# This is a sample build configuration for .NET Core.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: microsoft/aspnetcore-build
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- echo "Default executing..."
# Generate build number
- BUILD_NUMBER=`git log --oneline | wc -l`
- echo "Build number':' ${BUILD_NUMBER}"
# Install Nuget Package
- apt-get update && apt-get install -y nuget
# Configure Nuget Package
- nuget setApiKey ${NUGET_APIKEY} -Source ${NUGET_URL}
# Restore package of Private Server
- nuget restore -source ${NUGET_URL}
# Restore packages
- dotnet restore
# Build project
- dotnet build
# Run tests
- dotnet test ${PROJECT_NAME}.Tests/${PROJECT_NAME}.Tests.csproj
# Create package
- dotnet pack --configuration ${BUILD_CONFIGURATION} --version-suffix=beta-$BUILD_NUMBER
# Push generated package(s)
- nuget push ${PROJECT_NAME}/bin/${BUILD_CONFIGURATION}/*.nupkg -Source ${NUGET_URL}
branches:
master:
- step:
script: # Modify the commands below to build your repository.
- echo "Master executing..."
# Generate build number
#- BUILD_NUMBER=`git log --oneline | wc -l`
#- echo "Build number':' ${BUILD_NUMBER}"
# Install Nuget Package
- apt-get update && apt-get install -y nuget
# Configure Nuget Package
- nuget setApiKey ${NUGET_APIKEY} -Source ${NUGET_URL}
# Restore package of Private Server
- nuget restore -source ${NUGET_URL}
# Restore packages
- dotnet restore
# Build project
- dotnet build
# Run tests
- dotnet test ${PROJECT_NAME}.Tests/${PROJECT_NAME}.Tests.csproj
# Create package
- dotnet pack --configuration ${BUILD_CONFIGURATION} --version-suffix #=release-$BUILD_NUMBER
# Push generated package(s)
- nuget push ${PROJECT_NAME}/bin/${BUILD_CONFIGURATION}/*.nupkg -Source ${NUGET_URL}
develop:
- step:
script: # Modify the commands below to build your repository.
- echo "Develop executing... for SDK"
# Generate build number
- BUILD_NUMBER=`git log --oneline | wc -l`
- echo "Build number':' ${BUILD_NUMBER}"
# Install Nuget Package
- apt-get update && apt-get install -y nuget
# Configure Nuget Package
- nuget setApiKey ${NUGET_APIKEY} -Source ${NUGET_URL}
# Restore package of Private Server
#- nuget restore -source ${NUGET_URL}
# Restore packages
- dotnet restore
# Build project
- dotnet build ${PROJECT_NAME}/${PROJECT_NAME}.csproj
# Run tests
# - dotnet test ${PROJECT_NAME}.Tests/${PROJECT_NAME}.Tests.csproj
# Create package
- dotnet pack ${PROJECT_NAME}/${PROJECT_NAME}.csproj --configuration ${BUILD_CONFIGURATION} --version-suffix=beta-$BUILD_NUMBER
# Push generated package(s)
- nuget push ${PROJECT_NAME}.SDK/bin/${BUILD_CONFIGURATION}/*.nupkg -Source ${NUGET_URL}
- echo "Develop executing... For Standard"
# Generate build number
- BUILD_NUMBER=`git log --oneline | wc -l`
- echo "Build number':' ${BUILD_NUMBER}"
# Create package
- dotnet pack --configuration ${BUILD_CONFIGURATION} --version-suffix=beta-$BUILD_NUMBER
# Push generated package(s)
- nuget push ${PROJECT_NAME}/bin/${BUILD_CONFIGURATION}/*.nupkg -Source ${NUGET_URL}