Skip to content

Commit e708edf

Browse files
committed
Move source code to /src, add files for CI/CD
1 parent 73173e2 commit e708edf

174 files changed

Lines changed: 300 additions & 83 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

appveyor.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: 1.0.{build}
2+
branches:
3+
only:
4+
- develop
5+
image: Ubuntu
6+
environment:
7+
MINIKUBE_VERSION: "1.0.0"
8+
KUBECTL_VERSION: "1.14.1"
9+
CHANGE_MINIKUBE_NONE_USER: "true"
10+
KUBECONFIG: "/home/appveyor/.kube/config"
11+
MINIKUBE_HOME: "/home/appveyor/kubernetes"
12+
MINIKUBE_WANTUPDATENOTIFICATION: "false"
13+
MINIKUBE_WANTREPORTERRORPROMPT: "false"
14+
#APPVEYOR_SSH_BLOCK: true
15+
APPVEYOR_SSH_KEY: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCmgZMwyHhjf+VteXZ9yVDNPjttoXwY9guLrknAsoQAAOKyMkLck3HgrT/ZARg/hmDAlEIxG504Xb6wBGJpLjxWA0WlSBuk86I9ejnnsEUOu9zSZHXXYYsoR7lhIdOP05Ifs8aYCpONYZkWSzee9cwZlLehHPwLXzM6FcJbaYoXZlGLuxzg3J5MY5MPnFi6uj3h0lJRIfbclU15RT3fNIp9olOUg8WpzqYJWNdv9AZQvF9z+WugVUw9grGrpXbOH7iK+FFN1IgTdiLYrh1SHOi9fGLA4BrOYcyclAvuFryy4t2Wu6wFcm1rZR5sCsEbXRYB3ZheiHeVJd3QWGDjser1u7A5kv391iyiOQSvQBkNWt1t6LYnH5fOL5+6vZMAGm/od7+M8F4ozpeA79opXcn8pHbK9uH8Dw2+/vgJ1BfiL32OCbn/Fby/hyxfwnT6SBllwz2UcNBx6tzCCZAXjugPr2kUvpE100a9Xc7czLOk7KIjznV5gKHnjGP+27q6SDIwN58sSw0R//MqbavhXeenLe/eZ7HU0/l/q6jCdcq2Vay1pyNI+Uga1PuKH/BO8bMseWr0/1Z5TMt3z0lFwCTHBjtgPOj8VCgV8oBOza1+5rxw0rdWrsuBACmJFzduhldCYK4M5gYehb4ZAJyg7U2XL/FuDD8fcw+5dO+Z1YLW3w== openpgp:0x0A2ADCAF"
16+
services:
17+
- docker
18+
19+
install:
20+
- sh: |
21+
22+
. ./build/git_versioning.sh
23+
24+
export APP_VERSION=${version}
25+
export FILE_VERSION=${fileVersion}
26+
export INFORMATIONAL_VERSION=${informationVersion}
27+
28+
echo "exported app version is $APP_VERSION"
29+
echo "exported file version is $FILE_VERSION"
30+
echo "exported info version is $INFORMATIONAL_VERSION"
31+
32+
- ps: Update-AppveyorBuild -Version $env:APP_VERSION
33+
build_script:
34+
- sh: |
35+
36+
cd ./src
37+
38+
dotnet build GridDomain.sln /p:Version=$APP_VERSION /p:FileVersion=$FILE_VERSION /p:InformationVersion="$INFORMATIONAL_VERSION" -c Release -v Minimal /l:"/opt/appveyor/build-agent/AppVeyor.MSBuildLogger.dll"
39+
dotnet pack GridDomain.sln /p:Version=$APP_VERSION /p:FileVersion=$FILE_VERSION /p:InformationVersion="$INFORMATIONAL_VERSION" -c Release -v Minimal --include-symbols --include-source --no-build /l:"/opt/appveyor/build-agent/AppVeyor.MSBuildLogger.dll"
40+
test_script:
41+
- sh: |
42+
43+
44+
#curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
45+
46+
. ./build/test.sh
47+
48+
runTests UnitTests GridDomain.Node.Tests Release
49+
runTests AcceptanceTests GridDomain.Aggregates.Tests Release
50+
runTests ScenarioTests GridDomain.Scenarios.Tests Release
51+
runTests ClusterUnitTests GridDomain.Cluster.Tests Release
52+
53+
artifacts:
54+
- path: '**\GridDomain.*.nupkg'
55+
name: Packages
56+
- path: '**\*.zip'
57+
name: TestResults
58+
deploy:
59+
- provider: Environment
60+
name: MyGet development feed

build/git_versioning.sh

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#This script will fetch semver-compatible information from git tag
2+
#it should be lauched from root folder of repository
3+
#script expects a git tag in ..(-) format
4+
#stage part is optional
5+
#script will provide version information in form of bash variables
6+
#for .Net assemblies versioning (https://andrewlock.net/version-vs-versionsuffix-vs-packageversion-what-do-they-all-mean/):
7+
#${fileVersion}
8+
#${informationVersion}
9+
#${version}
10+
#if tag is found on HEAD, version will be taken as-is from it
11+
#if we have some commits on top of latest tag script will bump
12+
#the minor part from this tag by one, and, if stage is missing, add '-preview' stage
13+
14+
15+
#if we are not on commit with tag, lets put information about number of commits from latest tag
16+
describe=`git describe --tags --always`
17+
#fallback if we have no tags at all reachable from HEAD
18+
#tagName will be latest commit hash
19+
if [[ "${describe}" =~ ^[A-Fa-f0-9]+$ ]]; then
20+
echo "No tags found, using defaults"
21+
major="0"
22+
minor="0"
23+
patch="0"
24+
numericVersion="0.0.0"
25+
stage=""
26+
commit_num=`git rev-list HEAD --count`
27+
#build some magic string to generalize some code below
28+
commit_num_and_hash="-$commit_num-aaa"
29+
else
30+
31+
tagName=`git describe --tags --abbrev=0`
32+
33+
major=`echo $tagName | awk '{split($0,a,"."); print a[1]}'`
34+
minor=`echo $tagName | awk '{split($0,a,"."); print a[2]}'`
35+
patch=`echo $tagName | awk '{split($0,a,"."); print a[3]}'`
36+
numericVersion=`echo $tagName | awk '{split($0,a,"-"); print a[1]}'`
37+
stage=`echo $tagName | awk '{split($0,a,"-"); print a[2]}'`
38+
39+
#commit and num will have format like '-3-abc'
40+
commit_num_and_hash=${describe#$tagName}
41+
echo "commit and hash part:${commit_num_and_hash}"
42+
fi
43+
44+
45+
if [ "${commit_num_and_hash}" = "" ]; then
46+
#HEAD commit has tag on it.
47+
echo "Found tag at HEAD commit"
48+
fileVersion=${numericVersion}.0
49+
if [ "${stage}" = "" ]; then
50+
# just removing empty space from the end and empty dash
51+
informationVersion="${major}.${minor}"
52+
version=${numericVersion}
53+
else
54+
informationVersion="${major}.${minor} ${stage}"
55+
version=${numericVersion}-${stage}
56+
fi
57+
else
58+
#HEAD commit does not have tag on it
59+
echo "HEAD commit doesnt have a tag"
60+
61+
bumpedMinor=$((${minor}+1))
62+
numericVersion=${major}.${bumpedMinor}.0
63+
echo "Bumping minor version from ${minor} to ${bumpedMinor}"
64+
65+
commit_num=`echo $commit_num_and_hash | awk '{split($0,a,"-"); print a[2]}'`
66+
fileVersion=${numericVersion}.${commit_num}
67+
68+
if [ "${stage}" = "" ]; then
69+
stage="preview"
70+
echo "Auto adding preview stage to version"
71+
fi
72+
73+
informationVersion="${major}.${bumpedMinor} ${stage}"
74+
version=${numericVersion}-${stage}${commit_num}
75+
fi
76+
77+
78+
echo File version is ${fileVersion}
79+
echo Information version is ${informationVersion}
80+
echo Version is ${version}
81+

build/test.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
runTests()
3+
{
4+
testsName=$1
5+
testsFolder=$2
6+
configuration=$3
7+
8+
cd $testsFolder
9+
echo Running tests in $testsFolder
10+
dotnet test --no-build --configuration $configuration --no-restore --logger trx > TestsOutput.txt
11+
TestResult=$?
12+
13+
echo Looking for a tests results
14+
cd ./bin/$configuration/netcoreapp2.0/Logs
15+
zip -r ./"$testsName"Logs.zip ./*
16+
17+
cd -
18+
cd ..
19+
20+
if [ $TestResult -ne 0 ];then
21+
echo should exit...
22+
#exit #$TestResult
23+
fi
24+
echo continue
25+
26+
}

GridDomain.Aggregates.Tests/AggregateAddressTests.cs renamed to src/GridDomain.Aggregates.Tests/AggregateAddressTests.cs

File renamed without changes.

GridDomain.Aggregates.Tests/GridDomain.Aggregates.Tests.csproj renamed to src/GridDomain.Aggregates.Tests/GridDomain.Aggregates.Tests.csproj

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)