Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Allow download of snapshot MSIs (#197)
Browse files Browse the repository at this point in the history
* Allow download of snapshot MSIs

This commit adds the ability to download snapshot MSIs for integration tests

(cherry picked from commit a85b475)
  • Loading branch information
russcam committed May 23, 2018
1 parent 57d225f commit 9477cf5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions build/scripts/Products.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#r "FakeLib.dll"

open System
open System.Globalization
open System.IO
open Fake
open Fake.FileHelper

module Paths =

let BuildDir = "./build/"
let ToolsDir = BuildDir @@ "tools/"
let InDir = BuildDir @@ "in/"
Expand All @@ -25,9 +25,11 @@ module Paths =

let ArtifactDownloadsUrl = "https://artifacts.elastic.co/downloads"

let StagingDownloadsUrl product version hash =
sprintf "https://staging.elastic.co/%s-%s/downloads/windows-installers/%s/%s-%s.msi"
version hash product product version
let StagingDownloadsUrl product hash fullVersion =
sprintf "https://staging.elastic.co/%s-%s/downloads/%s/%s-%s.msi" fullVersion hash product product fullVersion

let SnapshotDownloadsUrl product versionNumber hash fullVersion =
sprintf "https://snapshots.elastic.co/%s-%s/downloads/%s/%s-%s.msi" versionNumber hash product product fullVersion

module Products =
open Paths
Expand Down Expand Up @@ -100,7 +102,9 @@ module Products =
| Released ->
sprintf "%s/%s/%s-%s.msi" ArtifactDownloadsUrl this.Name this.Name version.FullVersion
| BuildCandidate hash ->
StagingDownloadsUrl this.Name version.FullVersion hash
if (version.FullVersion.EndsWith("snapshot", StringComparison.OrdinalIgnoreCase))
then SnapshotDownloadsUrl this.Name (sprintf "%i.%i.%i" version.Major version.Minor version.Patch) hash version.FullVersion
else StagingDownloadsUrl this.Name hash version.FullVersion

member private this.ZipFile (version:Version) =
let fullPathInDir = InDir |> Path.GetFullPath
Expand Down

0 comments on commit 9477cf5

Please sign in to comment.