From e131fc9214f9ac9edc85f626a2817381bc983471 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 04:49:46 -0800 Subject: [PATCH 01/15] first pass with tests --- Geocoding.sln | 7 ++ .../Geocoding.UsCensusBureau.csproj | 37 +++++++ .../UsCensusBureauAddress.cs | 11 +++ .../UsCensusBureauConstants.cs | 19 ++++ .../UsCensusBureauGeocoder.cs | 98 +++++++++++++++++++ test/Geocoding.Tests/GeocoderTest.cs | 9 +- test/Geocoding.Tests/Geocoding.Tests.csproj | 1 + test/Geocoding.Tests/UsCensusBureauTest.cs | 67 +++++++++++++ 8 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 src/Geocoding.UsCensusBureau/Geocoding.UsCensusBureau.csproj create mode 100644 src/Geocoding.UsCensusBureau/UsCensusBureauAddress.cs create mode 100644 src/Geocoding.UsCensusBureau/UsCensusBureauConstants.cs create mode 100644 src/Geocoding.UsCensusBureau/UsCensusBureauGeocoder.cs create mode 100644 test/Geocoding.Tests/UsCensusBureauTest.cs diff --git a/Geocoding.sln b/Geocoding.sln index 6cbe577..29f7a5f 100644 --- a/Geocoding.sln +++ b/Geocoding.sln @@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Geocoding.Tests", "test\Geo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Geocoding.Here", "src\Geocoding.Here\Geocoding.Here.csproj", "{41F9E0D3-2094-4CE7-A2CD-F3CAF585A048}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Geocoding.UsCensusBureau", "src\Geocoding.UsCensusBureau\Geocoding.UsCensusBureau.csproj", "{45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -53,6 +55,10 @@ Global {41F9E0D3-2094-4CE7-A2CD-F3CAF585A048}.Debug|Any CPU.Build.0 = Debug|Any CPU {41F9E0D3-2094-4CE7-A2CD-F3CAF585A048}.Release|Any CPU.ActiveCfg = Release|Any CPU {41F9E0D3-2094-4CE7-A2CD-F3CAF585A048}.Release|Any CPU.Build.0 = Release|Any CPU + {45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -63,6 +69,7 @@ Global {27F58640-D424-40F5-945E-42BF8BC872A0} = {F742864D-9400-4CE2-957A-DBD0A0237277} {9773C7DA-DD1A-490D-B4D8-CEA18804AD1E} = {F742864D-9400-4CE2-957A-DBD0A0237277} {41F9E0D3-2094-4CE7-A2CD-F3CAF585A048} = {F742864D-9400-4CE2-957A-DBD0A0237277} + {45E82D63-BEC0-4DF2-AC0E-AEB2D235ED5B} = {F742864D-9400-4CE2-957A-DBD0A0237277} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {085E97E6-56E0-4099-94E9-10F9080F2DD1} diff --git a/src/Geocoding.UsCensusBureau/Geocoding.UsCensusBureau.csproj b/src/Geocoding.UsCensusBureau/Geocoding.UsCensusBureau.csproj new file mode 100644 index 0000000..e37daeb --- /dev/null +++ b/src/Geocoding.UsCensusBureau/Geocoding.UsCensusBureau.csproj @@ -0,0 +1,37 @@ + + + + Includes a model and interface for communicating with four popular Geocoding providers. Current implementations include: Google Maps, Yahoo! PlaceFinder, Bing Maps (aka Virtual Earth), and Mapquest. The API returns latitude/longitude coordinates and normalized address information. This can be used to perform address validation, real time mapping of user-entered addresses, distance calculations, and much more. + Geocoding.net UsCensusBureau + 4.0.0-beta1 + chadly + netstandard1.3;net46 + Geocoding.UsCensusBureau + Geocoding.UsCensusBureau + geocoding;geocode;geocoder;maps;address;validation;normalization;google-maps;bing-maps;yahoo-placefinder;mapquest + https://github.com/chadly/Geocoding.net/releases/latest + https://github.com/chadly/Geocoding.net + https://github.com/chadly/Geocoding.net/blob/master/LICENSE + https://github.com/chadly/Geocoding.net.git + git + 4.0.0 + + + + + + + + + + + + + + + + + + + + diff --git a/src/Geocoding.UsCensusBureau/UsCensusBureauAddress.cs b/src/Geocoding.UsCensusBureau/UsCensusBureauAddress.cs new file mode 100644 index 0000000..2e90d79 --- /dev/null +++ b/src/Geocoding.UsCensusBureau/UsCensusBureauAddress.cs @@ -0,0 +1,11 @@ +namespace Geocoding.UsCensusBureau +{ + public class UsCensusBureauAddress : Address + { + public UsCensusBureauAddress(string formattedAddress, Location coordinates) + : base(formattedAddress, coordinates, UsCensusBureauConstants.Provider) + { + + } + } +} diff --git a/src/Geocoding.UsCensusBureau/UsCensusBureauConstants.cs b/src/Geocoding.UsCensusBureau/UsCensusBureauConstants.cs new file mode 100644 index 0000000..247fec5 --- /dev/null +++ b/src/Geocoding.UsCensusBureau/UsCensusBureauConstants.cs @@ -0,0 +1,19 @@ +namespace Geocoding.UsCensusBureau +{ + public class UsCensusBureauConstants + { + public const string Provider = "UsCensusBureau"; + + public const string BaseUrl = "https://geocoding.geo.census.gov/geocoder/"; + public const string OneLineAddressPath = "locations/onelineaddress?"; + public const string AddressPath = "locations/address?"; + + public const string AddressMatchesKey = "addressMatches"; + public const string MatchedAddressKey = "matchedAddress"; + public const string CoordinatesKey = "coordinates"; + public const string ResultKey = "result"; + public const string ErrorsKey = "errors"; + public const string XKey = "x"; + public const string YKey = "y"; + } +} diff --git a/src/Geocoding.UsCensusBureau/UsCensusBureauGeocoder.cs b/src/Geocoding.UsCensusBureau/UsCensusBureauGeocoder.cs new file mode 100644 index 0000000..fc37ed7 --- /dev/null +++ b/src/Geocoding.UsCensusBureau/UsCensusBureauGeocoder.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json.Linq; + +namespace Geocoding.UsCensusBureau +{ + /// + /// refs: + /// - https://geocoding.geo.census.gov/ + /// - https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.pdf + /// + public class UsCensusBureauGeocoder : IGeocoder + { + private readonly int _benchmark; + private readonly string _format; + private readonly HttpClient _client; + + public UsCensusBureauGeocoder(int benchmark = 4, string format = "json") + { + _benchmark = benchmark; + _format = format; + _client = new HttpClient { BaseAddress = new Uri(UsCensusBureauConstants.BaseUrl) }; + } + + public async Task> GeocodeAsync(string address, CancellationToken cancellationToken = default(CancellationToken)) + { + // Build Query String + var sb = new StringBuilder(UsCensusBureauConstants.OneLineAddressPath); + sb.Append("address=").Append(WebUtility.UrlEncode(address)) + .Append("&benchmark=").Append(_benchmark) + .Append("&format=").Append(_format); + + // Get Request + var response = await _client.GetAsync(sb.ToString(), cancellationToken); + var content = await response.Content.ReadAsStringAsync(); + + // Read Result + return GetAddresses(content); + } + + public async Task> GeocodeAsync(string street, string city, string state, string postalCode, string country, CancellationToken cancellationToken = default(CancellationToken)) + { + // Build Query String + var sb = new StringBuilder(UsCensusBureauConstants.AddressPath); + sb.Append("street=").Append(WebUtility.UrlEncode(street)) + .Append("&city=").Append(WebUtility.UrlEncode(city)) + .Append("&state=").Append(WebUtility.UrlEncode(state)) + .Append("&zip=").Append(WebUtility.UrlEncode(postalCode)) + .Append("&benchmark=").Append(_benchmark) + .Append("&format=").Append(_format); + + // Get Request + var response = await _client.GetAsync(sb.ToString(), cancellationToken); + var content = await response.Content.ReadAsStringAsync(); + + // Read Result + return GetAddresses(content); + } + + public Task> ReverseGeocodeAsync(Location location, CancellationToken cancellationToken = default(CancellationToken)) + { + throw new NotSupportedException(); + } + + public Task> ReverseGeocodeAsync(double latitude, double longitude, CancellationToken cancellationToken = default(CancellationToken)) + { + throw new NotSupportedException(); + } + + private static IEnumerable GetAddresses(string response) + { + var json = JObject.Parse(response); + + var errors = json[UsCensusBureauConstants.ErrorsKey]; + if (errors != null) + return new UsCensusBureauAddress[] {}; + + var result = json[UsCensusBureauConstants.ResultKey]; + return result[UsCensusBureauConstants.AddressMatchesKey] + .Select(match => + { + var formatted = match[UsCensusBureauConstants.MatchedAddressKey].ToString(); + var coordinates = match[UsCensusBureauConstants.CoordinatesKey]; + var x = double.Parse(coordinates[UsCensusBureauConstants.XKey].ToString()); + var y = double.Parse(coordinates[UsCensusBureauConstants.YKey].ToString()); + + return new UsCensusBureauAddress(formatted, new Location(y, x)); + }) + .ToArray(); + } + } +} diff --git a/test/Geocoding.Tests/GeocoderTest.cs b/test/Geocoding.Tests/GeocoderTest.cs index 82be0a9..fb75d6f 100644 --- a/test/Geocoding.Tests/GeocoderTest.cs +++ b/test/Geocoding.Tests/GeocoderTest.cs @@ -1,15 +1,12 @@ -using System.Globalization; -using System.Linq; -using System.Threading; +using System.Linq; using System.Threading.Tasks; using Xunit; -using Xunit.Extensions; namespace Geocoding.Tests { public abstract class GeocoderTest { - readonly IGeocoder geocoder; + protected readonly IGeocoder geocoder; protected readonly SettingsFixture settings; public GeocoderTest(SettingsFixture settings) @@ -106,4 +103,4 @@ public virtual async Task CanGeocodeInvalidZipCodes(string address) Assert.NotEmpty(addresses); } } -} \ No newline at end of file +} diff --git a/test/Geocoding.Tests/Geocoding.Tests.csproj b/test/Geocoding.Tests/Geocoding.Tests.csproj index df58082..41db7b3 100644 --- a/test/Geocoding.Tests/Geocoding.Tests.csproj +++ b/test/Geocoding.Tests/Geocoding.Tests.csproj @@ -23,6 +23,7 @@ + diff --git a/test/Geocoding.Tests/UsCensusBureauTest.cs b/test/Geocoding.Tests/UsCensusBureauTest.cs new file mode 100644 index 0000000..6e89b0c --- /dev/null +++ b/test/Geocoding.Tests/UsCensusBureauTest.cs @@ -0,0 +1,67 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Geocoding.UsCensusBureau; +using Xunit; + +namespace Geocoding.Tests +{ + [Collection("Settings")] + public class UsCensusBureauTest : GeocoderTest + { + public UsCensusBureauTest(SettingsFixture settings) : base(settings) + { + } + + protected override IGeocoder CreateGeocoder() + { + return new UsCensusBureauGeocoder(); + } + + [Theory(Skip = "not supported - us addresses only")] + public override Task CanGeocodeAddressUnderDifferentCultures(string cultureName) + { + return Task.CompletedTask; + } + + [Theory(Skip = "not supported - reverse geocode")] + public override Task CanReverseGeocodeAddressUnderDifferentCultures(string cultureName) + { + return Task.CompletedTask; + } + + [Theory(Skip = "using different input with CanGeocodeWithSpecialCharacters2")] + public override Task CanGeocodeWithSpecialCharacters(string address) + { + return Task.CompletedTask; + } + + [Theory] + [InlineData("12110 CLAYTON ROAD TOWN & COUNTRY,SAINT LOUIS,MO,63131,US")] + public async Task CanGeocodeWithSpecialCharacters2(string address) + { + Address[] addresses = (await geocoder.GeocodeAsync(address)).ToArray(); + + //asserting no exceptions are thrown and that we get something + Assert.NotEmpty(addresses); + } + + [Theory(Skip = "not supported - exact addresses only")] + public override Task CanHandleStreetIntersectionsByAmpersand(string address) + { + return Task.CompletedTask; + } + + [Fact(Skip = "not supported - reverse geocode")] + public override Task CanReverseGeocodeAsync() + { + return Task.CompletedTask; + } + + [Theory(Skip = "not supported")] + public override Task CanGeocodeInvalidZipCodes(string address) + { + return Task.CompletedTask; + } + } +} From e72ffb9ebf3c4749c4b936ae5bab79083894289f Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 05:49:05 -0800 Subject: [PATCH 02/15] adding appveyor file --- appveyor.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..5707711 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,47 @@ +version: 4.0.1-{build} +skip_tags: true +image: ubuntu1804 + +environment: + github_apikey: + secure: scoX9iR0iwbkHsEc7X0doOONik+WW93s4adA4T3Zcbr2MrsEK6LWnMLfdSctATjx + nuget_apikey: + secure: i/4GCUy+iqG/ytoKAFwTXJqOjSNqnzo8gJmLiiB0dWjVG6j//71LC01FWWig5B9d + docker_password: + secure: 3BLFSWasBkoBDnePlBhgN0zzV0lRnmJ+BJ2WFEKHIKMt1f0j/CimHAZKFSzu9jvA + octopus_apikey: + secure: XUJisBpllF5tywdA3kclw3hbZqJ/MTnf90j6kTVxe8M= + +services: + - docker + +install: + - git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~/tools + - bash ~/tools/dist/shared/version.sh + - bash ~/tools/dist/dotnet/install.sh + - bash ~/tools/dist/dotnet/sonar.sh start + +build_script: bash ~/tools/dist/dotnet/build.sh $nuget_apikey +test_script: bash ~/tools/dist/dotnet/test.sh +after_test: + - bash ~/tools/dist/dotnet/sonar.sh stop + - bash ~/tools/dist/dotnet/publish_nuget.sh $nuget_apikey +deploy_script: + - bash ~/tools/dist/dotnet/publish_sf.sh $octopus_apikey + - bash ~/tools/dist/shared/publish_docker.sh $octopus_apikey $docker_password out + +artifacts: + - path: 'src\**\*.nupkg' + name: nuget-package + +cache: + - $HOME/.nuget/packages -> **\*.csproj + - $HOME/.dotnet/tools -> **\*.csproj + - packages -> **\*.csproj + +matrix: + fast_finish: true + +notifications: +- provider: Slack + incoming_webhook: https://hooks.slack.com/services/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 From f8bf2599ef593cdd4034c5fb4bfd598c9501fccb Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:12:40 -0800 Subject: [PATCH 03/15] appveyor changes --- appveyor.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5707711..8916ffc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ version: 4.0.1-{build} skip_tags: true -image: ubuntu1804 environment: github_apikey: @@ -18,17 +17,12 @@ services: install: - git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~/tools - bash ~/tools/dist/shared/version.sh - - bash ~/tools/dist/dotnet/install.sh - - bash ~/tools/dist/dotnet/sonar.sh start -build_script: bash ~/tools/dist/dotnet/build.sh $nuget_apikey -test_script: bash ~/tools/dist/dotnet/test.sh +build_script: MSBuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release +test_script: MSBuild test + after_test: - - bash ~/tools/dist/dotnet/sonar.sh stop - bash ~/tools/dist/dotnet/publish_nuget.sh $nuget_apikey -deploy_script: - - bash ~/tools/dist/dotnet/publish_sf.sh $octopus_apikey - - bash ~/tools/dist/shared/publish_docker.sh $octopus_apikey $docker_password out artifacts: - path: 'src\**\*.nupkg' From b25d8ec3294064c3bf7cc604047bb4bc8e683693 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:16:50 -0800 Subject: [PATCH 04/15] print help --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8916ffc..5b554f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,10 +19,12 @@ install: - bash ~/tools/dist/shared/version.sh build_script: MSBuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -test_script: MSBuild test +test_script: + - MSBuild --help + - MSBuild test after_test: - - bash ~/tools/dist/dotnet/publish_nuget.sh $nuget_apikey + - msbuild -t:pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts artifacts: - path: 'src\**\*.nupkg' From 3bb2629e945d26c088af72201d4735dc71a33201 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:19:08 -0800 Subject: [PATCH 05/15] switch init --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5b554f2..415641e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,9 +15,9 @@ services: - docker install: - - git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~/tools - - bash ~/tools/dist/shared/version.sh - + - git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools + - .\~\tools\dist\tools/Init.ps1 + build_script: MSBuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: - MSBuild --help From e51b6a5acc4267953c5f4c4d3385d428f330ee8f Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:20:33 -0800 Subject: [PATCH 06/15] disable tools --- appveyor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 415641e..221d07e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,13 +15,13 @@ services: - docker install: - - git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools - - .\~\tools\dist\tools/Init.ps1 + #- git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools + #- .\~\tools\dist\tools/Init.ps1 -build_script: MSBuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release +build_script: msbuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: - - MSBuild --help - - MSBuild test + - msbuild --help + - msbuild test after_test: - msbuild -t:pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts From b381843181ab3e15c2e9cdcda306d64ca25574c2 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:22:17 -0800 Subject: [PATCH 07/15] test --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 221d07e..184b9d2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,8 +20,7 @@ install: build_script: msbuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: - - msbuild --help - - msbuild test + - msbuild -t:test after_test: - msbuild -t:pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts From 7b14cc498cdcca80b6e664d71ef8f7027f20a830 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:23:37 -0800 Subject: [PATCH 08/15] test2 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 184b9d2..7649429 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ install: build_script: msbuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: - - msbuild -t:test + - msbuild test after_test: - msbuild -t:pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts From fa4e2e492278b248ac826a954883cf6add96ab5a Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:25:36 -0800 Subject: [PATCH 09/15] dotnet over msbuild --- appveyor.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7649429..e116a28 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,12 +18,9 @@ install: #- git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools #- .\~\tools\dist\tools/Init.ps1 -build_script: msbuild /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -test_script: - - msbuild test - -after_test: - - msbuild -t:pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts +build_script: dotnet build /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release +test_script: dotnet test +after_test: dotnet pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts artifacts: - path: 'src\**\*.nupkg' From 82f26b5acee297201292f28b0c7601c00b512a2d Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:26:39 -0800 Subject: [PATCH 10/15] windows env variables --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e116a28..9151653 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,9 +18,9 @@ install: #- git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools #- .\~\tools\dist\tools/Init.ps1 -build_script: dotnet build /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release +build_script: dotnet build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: dotnet test -after_test: dotnet pack /p:Version=$APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts +after_test: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts artifacts: - path: 'src\**\*.nupkg' From 19e168fc8fb41000358d2a654498d52adf9cffe3 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:29:46 -0800 Subject: [PATCH 11/15] adding ps --- appveyor.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9151653..053a931 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,9 +18,12 @@ install: #- git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools #- .\~\tools\dist\tools/Init.ps1 -build_script: dotnet build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -test_script: dotnet test -after_test: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts +build_script: + - ps: dotnet build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release +test_script: + - ps: dotnet test +after_test: + - ps: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts artifacts: - path: 'src\**\*.nupkg' From e36efca2eb5bf1b84fee21637321fcf3b710166e Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 06:32:19 -0800 Subject: [PATCH 12/15] ignore tests for now --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 053a931..18dfce3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ install: build_script: - ps: dotnet build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release test_script: - - ps: dotnet test + #- ps: dotnet test --filter after_test: - ps: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts From 8f95aa869bdeeac3b39469898de971f1b45742b4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 07:03:22 -0800 Subject: [PATCH 13/15] adding push --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 18dfce3..b280ed3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,8 @@ build_script: test_script: #- ps: dotnet test --filter after_test: - - ps: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o artifacts + - ps: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o ../../artifacts + - ps: dotnet nuget push artifacts\*.nupkg -k $env:nuget_apikey -s https://www.myget.org/F/280capmarkets/auth/$env:nuget_apikey/api/v3/index.json artifacts: - path: 'src\**\*.nupkg' From 2172a328fed6040fea9133e31ec20bc77316a44d Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 07:05:28 -0800 Subject: [PATCH 14/15] artifacts folder --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b280ed3..3d95f52 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,7 +27,7 @@ after_test: - ps: dotnet nuget push artifacts\*.nupkg -k $env:nuget_apikey -s https://www.myget.org/F/280capmarkets/auth/$env:nuget_apikey/api/v3/index.json artifacts: - - path: 'src\**\*.nupkg' + - path: 'artifacts\*.nupkg' name: nuget-package cache: From fecba4faf7b06249a1cc9f11a77138242bf26b58 Mon Sep 17 00:00:00 2001 From: "Daniel P. Rossi" Date: Sat, 22 Dec 2018 07:43:20 -0800 Subject: [PATCH 15/15] Revert "Merge branch 'master' into feature/UsCensusBureau" This reverts commit 30699806b10f9e4703223212cacbaba04bded593, reversing changes made to e131fc9214f9ac9edc85f626a2817381bc983471. --- appveyor.yml | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3d95f52..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 4.0.1-{build} -skip_tags: true - -environment: - github_apikey: - secure: scoX9iR0iwbkHsEc7X0doOONik+WW93s4adA4T3Zcbr2MrsEK6LWnMLfdSctATjx - nuget_apikey: - secure: i/4GCUy+iqG/ytoKAFwTXJqOjSNqnzo8gJmLiiB0dWjVG6j//71LC01FWWig5B9d - docker_password: - secure: 3BLFSWasBkoBDnePlBhgN0zzV0lRnmJ+BJ2WFEKHIKMt1f0j/CimHAZKFSzu9jvA - octopus_apikey: - secure: XUJisBpllF5tywdA3kclw3hbZqJ/MTnf90j6kTVxe8M= - -services: - - docker - -install: - #- git clone -b develop --single-branch https://$github_apikey@github.com/280CapMarkets/TwoEightyCap.DevOps.Tools.git ~\tools - #- .\~\tools\dist\tools/Init.ps1 - -build_script: - - ps: dotnet build /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -test_script: - #- ps: dotnet test --filter -after_test: - - ps: dotnet pack /p:Version=$env:APPVEYOR_BUILD_VERSION /p:Configuration=Release -o ../../artifacts - - ps: dotnet nuget push artifacts\*.nupkg -k $env:nuget_apikey -s https://www.myget.org/F/280capmarkets/auth/$env:nuget_apikey/api/v3/index.json - -artifacts: - - path: 'artifacts\*.nupkg' - name: nuget-package - -cache: - - $HOME/.nuget/packages -> **\*.csproj - - $HOME/.dotnet/tools -> **\*.csproj - - packages -> **\*.csproj - -matrix: - fast_finish: true - -notifications: -- provider: Slack - incoming_webhook: https://hooks.slack.com/services/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