-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
40 lines (39 loc) · 1.26 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
# 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/dotnet:2.0-sdk
pipelines:
default:
- step:
name: Build MQTTserver
caches:
- dotnetcore
script:
- dotnet restore
- dotnet publish MQTTserver -c release -o build
artifacts:
- MQTTserver/build/**
- step:
name: Run Tests
caches:
- dotnetcore
script:
- dotnet restore
- dotnet test Tests
- step:
name: Publish the container
caches:
- dotnetcore
script:
- cd MQTTserver
- docker login -u $dockerHubUsername -p $dockerHubPWD
- docker build . -t mqtt_image
- path="clumsypilot/cd_bitbucket_demo:"
- tag=$(echo "$BITBUCKET_BRANCH" | tr -dc '[:alnum:]\n\r-_' | tr '/*' '_'| tr '[:upper:]' '[:lower:]')
- echo "container name is $path$tag"
- docker tag mqtt_image "$path$tag"
- docker push "$path$tag"
services:
- docker