|
1 | 1 | @echo off |
2 | 2 |
|
3 | | -REM USAGE: |
4 | | -REM |
5 | | -REM build [skiptests] <command> [params] |
6 | | -REM |
7 | | -REM COMMANDS: |
8 | | -REM |
9 | | -REM * build |
10 | | -REM default target if non provided. Performs a clean, rebuild and test of all target frameworks |
11 | | -REM * quick [testfilter] |
12 | | -REM incremental build and unit test for .NET 4.5, [testfilter] allows you to do |
13 | | -REM a contains match on the tests to be run. |
14 | | -REM * build release <version> |
15 | | -REM create a release worthy nuget packages for [version] under build\output |
16 | | -REM * build integrate <elasticsearch_versions> [clustername] [testfilter] - |
17 | | -REM run integration tests for <elasticsearch_versions> which is a semicolon separated list of |
18 | | -REM elasticsearch versions to test or `latest`. Can filter tests by <clustername> and <testfilter> |
19 | | -REM * build canary [apikey] [feed] [skiptests] |
20 | | -REM create a canary nuget package based on the current version if [feed] and [apikey] are provided |
21 | | -REM also pushes to upstream (myget) |
22 | | - |
23 | | -SET TARGET="build" |
24 | | -SET VERSION= |
25 | | -SET ESVERSIONS= |
26 | | -SET SKIPTESTS=0 |
27 | | -SET APIKEY= |
28 | | -SET APIKEYPROVIDED="<empty>" |
29 | | -SET FEED="elasticsearch-net" |
30 | | -SET NEST_INTEGRATION_CLUSTER= |
31 | | -SET NEST_TEST_FILTER= |
32 | | -SET ELASTICSEARCH= |
33 | | -SET INTEGRATE_CLR="one" |
34 | | - |
35 | | -IF /I "%1"=="skiptests" ( |
36 | | - set SKIPTESTS="1" |
37 | | - SHIFT |
38 | | -) |
39 | | -IF NOT [%1]==[] (set TARGET=%1) |
40 | | - |
41 | | -SET SKIPPAKET=0 |
42 | | -IF /I "%TARGET%"=="inc" SET SKIPPAKET=1 |
43 | | -IF /I "%TARGET%"=="canary" SET SKIPTESTS=1 |
44 | | - |
45 | | -IF "%SKIPPAKET%" neq "1" ( |
46 | | - .paket\paket.bootstrapper.exe |
47 | | - IF EXIST paket.lock (.paket\paket.exe restore) |
48 | | - IF NOT EXIST paket.lock (.paket\paket.exe install) |
49 | | -) |
50 | | - |
51 | | -REM if `build quick` is called on a fresh checkout force a restore anyway |
52 | | -IF "%SKIPPAKET%"=="1" ( |
53 | | - IF NOT EXIST .paket\paket.exe ( |
54 | | - .paket\paket.bootstrapper.exe |
55 | | - ) |
56 | | - IF EXIST paket.lock (.paket\paket.exe restore) |
57 | | - IF NOT EXIST paket.lock (.paket\paket.exe install) |
58 | | -) |
59 | | - |
60 | | -IF /I "%TARGET%"=="version" ( |
61 | | - IF NOT [%2]==[] (set VERSION="%2") |
62 | | -) |
63 | | -IF /I "%TARGET%"=="release" ( |
64 | | - IF NOT [%2]==[] (set VERSION="%2") |
65 | | - IF /I "%JAVA_HOME%"=="" ( |
66 | | - ECHO JAVA_HOME not set exiting release early! |
67 | | - EXIT /B 1 |
68 | | - ) |
69 | | -) |
70 | | -IF /I "%TARGET%"=="inc" ( |
71 | | - IF NOT [%2]==[] (set NEST_TEST_FILTER="%2") |
72 | | -) |
73 | | -IF /I "%TARGET%"=="integrate-all" ( |
74 | | - SET TARGET="integrate" |
75 | | - SET INTEGRATE_CLR="all" |
76 | | - IF NOT [%2]==[] (set ESVERSIONS="%2") |
77 | | - IF NOT [%3]==[] (set NEST_INTEGRATION_CLUSTER="%~3") |
78 | | - IF NOT [%4]==[] (set NEST_TEST_FILTER="%4") |
79 | | -) |
80 | | -IF /I "%TARGET%"=="integrate" ( |
81 | | - IF NOT [%2]==[] (set ESVERSIONS="%2") |
82 | | - IF NOT [%3]==[] (set NEST_INTEGRATION_CLUSTER="%~3") |
83 | | - IF NOT [%4]==[] (set NEST_TEST_FILTER="%4") |
84 | | - IF /I "%JAVA_HOME%"=="" ( |
85 | | - ECHO JAVA_HOME not set exiting release early! |
86 | | - EXIT /B 1 |
87 | | - ) |
88 | | -) |
89 | | -IF /I "%TARGET%"=="canary" ( |
90 | | - IF NOT [%2]==[] ( |
91 | | - set APIKEY="%2" |
92 | | - SET APIKEYPROVIDED="<redacted>" |
93 | | - ) |
94 | | - IF NOT [%3]==[] set FEED="%3" |
95 | | -) |
96 | | -IF /I "%TARGET%"=="profile" ( |
97 | | - IF NOT [%2]==[] (set ELASTICSEARCH="%2") |
98 | | - IF NOT [%3]==[] (set NEST_TEST_FILTER="%3") |
99 | | -) |
100 | | - |
101 | | -ECHO build.bat: target=%TARGET% skippakket=%SKIPPAKET% version=%VERSION% esversions=%ESVERSIONS% skiptests=%SKIPTESTS% apiKey=%APIKEYPROVIDED% feed=%FEED% escluster=%NEST_INTEGRATION_CLUSTER% testfilter=%NEST_TEST_FILTER% elasticsearch=%ELASTICSEARCH% integrateclr=%INTEGRATE_CLR% |
102 | | -"packages\build\FAKE\tools\Fake.exe" "build\\scripts\\Targets.fsx" "target=%TARGET%" "version=%VERSION%" "esversions=%ESVERSIONS%" "skiptests=%SKIPTESTS%" "apiKey=%APIKEY%" "feed=%FEED%" "escluster=%NEST_INTEGRATION_CLUSTER%" "testfilter=%NEST_TEST_FILTER%" "elasticsearch=%ELASTICSEARCH%" "integrateclr=%INTEGRATE_CLR%" |
| 3 | +.paket\paket.bootstrapper.exe |
| 4 | +IF EXIST paket.lock (.paket\paket.exe restore) |
| 5 | +IF NOT EXIST paket.lock (.paket\paket.exe install) |
| 6 | +"packages\build\FAKE\tools\Fake.exe" "build\\scripts\\Targets.fsx" "cmdline=%*" |
0 commit comments