forked from exceptionless/Exceptionless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
71 lines (61 loc) · 2.52 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
67
68
69
70
71
version: '{build}'
image: ubuntu
clone_depth: 2
services:
- docker
environment:
API_DOCKER_IMAGE: api-ci
JOB_DOCKER_IMAGE: job-ci
pull_requests:
do_not_increment_build_number: true
init:
- git config --global core.autocrlf input
before_build:
- |
VERSION_PREFIX=$(sed -n 's/.*<VersionPrefix>\([^<]*\)<\/VersionPrefix>.*/\1/p' <<< cat ./build/common.props)
if [ $APPVEYOR_REPO_TAG != "true" ]; then
VERSION_SUFFIX="$APPVEYOR_BUILD_NUMBER-pre"
VERSION="$VERSION_PREFIX.$VERSION_SUFFIX"
echo "Version: $VERSION"
else
VERSION_SUFFIX=$APPVEYOR_BUILD_NUMBER
VERSION="$VERSION_PREFIX.$VERSION_SUFFIX"
echo "Version: $VERSION Tag: $APPVEYOR_REPO_TAG_NAME"
fi
if [ -z $APPVEYOR_PULL_REQUEST_NUMBER ]; then
appveyor UpdateBuild -Version $VERSION
fi
install:
- |
curl https://storage.googleapis.com/kubernetes-helm/helm-v2.12.1-linux-amd64.tar.gz -o helm.tar.gz
tar -zxvf helm.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
build_script:
- docker build --target testrunner -t exceptionless:test --build-arg VERSION_SUFFIX=$VERSION_SUFFIX .
- docker run -d -m 2g -p 9200:9200 -p 9300:9300 -e discovery.type=single-node -e xpack.security.enabled=false -e ES_JAVA_OPTS='-Xms512m -Xmx512m' slideroom/elasticsearch:98
- docker run -e APPVEYOR_API_URL --net=host -v $(pwd)/artifacts:/app/artifacts exceptionless:test
- docker build --target api -t $API_DOCKER_IMAGE --build-arg VERSION_SUFFIX=$VERSION_SUFFIX .
- docker build --target job -t $JOB_DOCKER_IMAGE --build-arg VERSION_SUFFIX=$VERSION_SUFFIX .
deploy_script:
- echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
- |
# tag and push docker image
for image in {$API_DOCKER_IMAGE,$JOB_DOCKER_IMAGE}; do
for tag in {$VERSION,latest}; do
docker tag $image exceptionless/$image:$tag
docker push exceptionless/$image:$tag
done
done
- |
# deploy latest images to k8s cluster
# az login --service-principal --username $AZ_USERNAME --password $AZ_PASSWORD --tenant $AZ_TENANT
# az aks get-credentials --resource-group exceptionless-test --name ex-k8s-test2
# helm upgrade --set "api.image.tag=$VERSION" --set "jobs.image.tag=$VERSION" --reuse-values exceptionless-test ./k8s/exceptionless
artifacts:
- path: artifacts/*.trx
name: Test Results
notifications:
- provider: Slack
auth_token:
secure: GniMpFE62HprSyQNQoej/VSBnxn2GNnTrca3BnF8+ikMdqduO4Ts4t297teZF6wDAmGwnOtXusctUla8+WxLFkIztvVCS2Z1RG/DvEDYoc0=
channel: '#notifications'