| 1 |
$env:JAVA_HOME="C:\Program Files\Java\jdk1.8.0" |
| 2 |
$env:PATH="$($env:JAVA_HOME)\bin;$($env:PATH)" |
| 3 |
$env:CCM_PATH="C:\Users\appveyor\ccm" |
| 4 |
$env:CASSANDRA_VERSION=$env:cassandra_version |
| 5 |
$env:EVENT_LOOP_MANAGER="asyncore" |
| 6 |
$env:SIMULACRON_JAR="C:\Users\appveyor\simulacron-standalone-0.7.0.jar" |
| 7 |
|
| 8 |
python --version |
| 9 |
python -c "import platform; print(platform.architecture())" |
| 10 |
# Install Ant |
| 11 |
Start-Process cinst -ArgumentList @("-y","ant") -Wait -NoNewWindow |
| 12 |
# Workaround for ccm, link ant.exe -> ant.bat |
| 13 |
If (!(Test-Path C:\ProgramData\chocolatey\bin\ant.bat)) { |
| 14 |
cmd /c mklink C:\ProgramData\chocolatey\bin\ant.bat C:\ProgramData\chocolatey\bin\ant.exe |
| 15 |
} |
| 16 |
|
| 17 |
|
| 18 |
$jce_indicator = "$target\README.txt" |
| 19 |
# Install Java Cryptographic Extensions, needed for SSL. |
| 20 |
If (!(Test-Path $jce_indicator)) { |
| 21 |
$zip = "C:\Users\appveyor\jce_policy-$($env:java_version).zip" |
| 22 |
$target = "$($env:JAVA_HOME)\jre\lib\security" |
| 23 |
# If this file doesn't exist we know JCE hasn't been installed. |
| 24 |
$url = "https://www.dropbox.com/s/po4308hlwulpvep/UnlimitedJCEPolicyJDK7.zip?dl=1" |
| 25 |
$extract_folder = "UnlimitedJCEPolicy" |
| 26 |
If ($env:java_version -eq "1.8.0") { |
| 27 |
$url = "https://www.dropbox.com/s/al1e6e92cjdv7m7/jce_policy-8.zip?dl=1" |
| 28 |
$extract_folder = "UnlimitedJCEPolicyJDK8" |
| 29 |
} |
| 30 |
# Download zip to staging area if it doesn't exist, we do this because |
| 31 |
# we extract it to the directory based on the platform and we want to cache |
| 32 |
# this file so it can apply to all platforms. |
| 33 |
if(!(Test-Path $zip)) { |
| 34 |
(new-object System.Net.WebClient).DownloadFile($url, $zip) |
| 35 |
} |
| 36 |
|
| 37 |
Add-Type -AssemblyName System.IO.Compression.FileSystem |
| 38 |
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $target) |
| 39 |
|
| 40 |
$jcePolicyDir = "$target\$extract_folder" |
| 41 |
Move-Item $jcePolicyDir\* $target\ -force |
| 42 |
Remove-Item $jcePolicyDir |
| 43 |
} |
| 44 |
|
| 45 |
# Download simulacron |
| 46 |
$simulacron_url = "https://github.com/datastax/simulacron/releases/download/0.7.0/simulacron-standalone-0.7.0.jar" |
| 47 |
$simulacron_jar = $env:SIMULACRON_JAR |
| 48 |
if(!(Test-Path $simulacron_jar)) { |
| 49 |
(new-object System.Net.WebClient).DownloadFile($simulacron_url, $simulacron_jar) |
| 50 |
} |
| 51 |
|
| 52 |
# Install Python Dependencies for CCM. |
| 53 |
Start-Process python -ArgumentList "-m pip install psutil pyYaml six numpy" -Wait -NoNewWindow |
| 54 |
|
| 55 |
# Clone ccm from git and use master. |
| 56 |
If (!(Test-Path $env:CCM_PATH)) { |
| 57 |
Start-Process git -ArgumentList "clone -b cassandra-test https://github.com/pcmanus/ccm.git $($env:CCM_PATH)" -Wait -NoNewWindow |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
# Copy ccm -> ccm.py so windows knows to run it. |
| 62 |
If (!(Test-Path $env:CCM_PATH\ccm.py)) { |
| 63 |
Copy-Item "$env:CCM_PATH\ccm" "$env:CCM_PATH\ccm.py" |
| 64 |
} |
| 65 |
|
| 66 |
$env:PYTHONPATH="$($env:CCM_PATH);$($env:PYTHONPATH)" |
| 67 |
$env:PATH="$($env:CCM_PATH);$($env:PATH)" |
| 68 |
|
| 69 |
# Predownload cassandra version for CCM if it isn't already downloaded. |
| 70 |
# This is necessary because otherwise ccm fails |
| 71 |
If (!(Test-Path C:\Users\appveyor\.ccm\repository\$env:cassandra_version)) { |
| 72 |
Start-Process python -ArgumentList "$($env:CCM_PATH)\ccm.py create -v $($env:cassandra_version) -n 1 predownload" -Wait -NoNewWindow |
| 73 |
echo "Checking status of download" |
| 74 |
python $env:CCM_PATH\ccm.py status |
| 75 |
Start-Process python -ArgumentList "$($env:CCM_PATH)\ccm.py remove predownload" -Wait -NoNewWindow |
| 76 |
echo "Downloaded version $env:cassandra_version" |
| 77 |
} |
| 78 |
|
| 79 |
Start-Process python -ArgumentList "-m pip install -r test-requirements.txt" -Wait -NoNewWindow |
| 80 |
Start-Process python -ArgumentList "-m pip install nose-ignore-docstring" -Wait -NoNewWindow |