forked from Cloudbox/Cloudbox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
66 lines (52 loc) · 2.17 KB
/
appveyor.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
---
version: 1.0.0-{build}
branches:
except:
- master
skip_tags: true
skip_commits:
files:
- '*.md'
- 'defaults/*'
- 'roles/*/files/*'
message: /\[minor\]/
image: ubuntu
matrix:
fast_finish: true
# to disable automatic builds
build: off
init:
- sh: curl -s https://cloudbox.works/scripts/dep.sh | sudo -H sh
install:
- sh: git submodule update --init --recursive
- sh: for i in defaults/*; do cp -n $i "$(basename "${i%.*}")"; done
- sh: sudo ansible-playbook cloudbox.yml --syntax-check
- sh: sudo ansible-playbook cloudbox.yml --tags "cloudbox" --skip-tags "settings" --extra-vars '{"continuous_integration":true}'
# https://boblokerse.github.io/2015/11/03/GitVersion-versioning-made-easy-and-dry/
on_finish:
- ps: |
function gitVersion() {
$env:newhash=git rev-parse HEAD
write-host "newhash = $env:newhash"
$env:shorthash=git rev-parse --short HEAD
write-host "shorthash = $env:shorthash"
$env:gitCommits=git describe --tags $env:APPVEYOR_REPO_BRANCH | %{$_.split('-')[1]}
write-host "gitCommits = $env:gitCommits"
$env:gitVersion=git describe --tags --abbrev=0 $env:APPVEYOR_REPO_BRANCH
write-host "gitVersion = $env:gitVersion"
$env:newVersion="$env:gitVersion-$env:gitCommits"
write-host "newVersion = $env:newVersion"
$env:appveyor_info_version="$env:newVersion-$env:APPVEYOR_REPO_BRANCH"
write-host "appveyor_info_version = $env:appveyor_info_version"
$env:appveyor_build_version="$env:newVersion"
write-host "appveyor_build_version = $env:appveyor_build_version"
appveyor UpdateBuild -Version "$env:newVersion"
if ($LastExitCode -ne 0) { appveyor UpdateBuild -Version "$env:APPVEYOR_BUILD_VERSION" }
write-host "=========================================="
write-host "Using hash for build version: $env:newhash"
write-host "Update appveyor build version to: $env:appveyor_build_version"
write-host "Update appveyor info version to: $env:appveyor_info_version"
}
if( -not ($env:APPVEYOR_PULL_REQUEST_NUMBER) -and ($env:APPVEYOR_REPO_BRANCH –eq "develop") ){
gitVersion
}