Use environement variables

This commit is contained in:
Francis ANDRE 2016-03-09 15:10:13 +01:00
parent 200ade5299
commit b4ecb76799

View File

@ -41,10 +41,10 @@ configuration:
environment:
bundling: bundled
mysql32: C:\mysql-5.7.9-win32
mysql64: C:\Program Files\MySql\MySQL Server 5.6
postgres32: C:\Program Files (x86)\PostgreSQL\9.4
postgres64: C:\Program Files\PostgreSQL\9.4
MYSQL32: C:\mysql-5.7.9-win32
MYSQL64: C:\Program Files\MySql\MySQL Server 5.6
POSTGRES32: C:\Program Files (x86)\PostgreSQL\9.4
POSTGRES64: C:\Program Files\PostgreSQL\9.4
matrix:
@ -162,17 +162,17 @@ install:
- ps: |
if ($env:platform -eq "Win32")
{
if (Test-Path "c:\mysql-5.7.9-win32") {
echo "using c:\mysql-5.7.9-win32 from cache"
if (Test-Path $env:MYSQL32) {
echo "using $env:MYSQL32 from cache"
}
else
{
echo "downloading mysql-5.7.9-win32"
Invoke-WebRequest "http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-win32.zip" -OutFile mysql-5.7.9-win32.zip
echo "installing c:\mysql-5.7.9-win32"
7z x -y mysql-5.7.9-win32.zip -oc:\
}
}
echo "downloading $env:MYSQL32"
Invoke-WebRequest "http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-win32.zip" -OutFile mysql-5.7.9-win32.zip
echo "installing $env:MYSQL32"
7z x -y mysql-5.7.9-win32.zip -oc:\
}
}
# -------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
@ -182,26 +182,23 @@ install:
- ps: |
if ($env:platform -eq "Win32")
{
if (Test-Path "C:\Program Files (x86)\PostgreSQL\9.4") {
echo "using C:\Program Files (x86)\PostgreSQL\9.4 from cache"
if (Test-Path $env:POSTGRES32) {
echo "using $env:POSTRGES32 from cache"
}
else
{
Write-Host "Installing PostgreSQL 9.4..." -ForegroundColor Cyan
Write-Host "Installing $env:POSTGRES32 ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$($env:USERPROFILE)\postgresql-9.4.5-1-windows.exe"
(New-Object Net.WebClient).DownloadFile('http://get.enterprisedb.com/postgresql/postgresql-9.4.5-1-windows.exe', $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath --mode unattended --superpassword Password12!
del $exePath
Write-Host "Setting up services..."
Stop-Service postgresql-9.4
Set-Service -Name postgresql-9.4 -StartupType Manual
Write-Host "PostgreSQL 9.4 installed" -ForegroundColor Green
Write-Host "$env:POSTGRES32 installed" -ForegroundColor Green
}
}
# -------------------------------------------------------------------------------------------
@ -244,23 +241,23 @@ before_build:
- ps: |
if ($env:platform -eq "Win32")
{
$env:INCLUDE = "C:\mysql-5.7.9-win32\include;" + $env:INCLUDE
$env:LIB = "C:\mysql-5.7.9-win32\lib;" + $env:LIB
$env:PATH = "C:\mysql-5.7.9-win32\bin;" + $env:PATH
if (Test-Path "C:\mysql-5.7.11-win32\lib\libmysql.dll") {
copy C:\mysql-5.7.11-win32\lib\libmysql.dll C:\mysql-5.7.11-win32\bin\libmysql.dll
$env:INCLUDE = $env:MYSQL32 + "\include;" + $env:INCLUDE
$env:LIB = $env:MYSQL32 + "\lib;" + $env:LIB
$env:PATH = $env:MYSQL32 + "\bin;" + $env:PATH
if (Test-Path ($env:MYSQL32 + "\lib\libmysql.dll")) {
copy $env:MYSQL32 + "\lib\libmysql.dll" $env:MYSQL32 + "\bin\libmysql.dll"
}
& C:\cygwin\ls -lR /cygwin/C/mysql-5.7.11-win32
& C:\cygwin\ibin\ls -lR %MYSQL32%
}
if ($env:platform -eq "x64")
{
$env:INCLUDE = "C:\Program Files\MySql\MySQL Server 5.6\include;" + $env:INCLUDE
$env:LIB = "C:\Program Files\MySql\MySQL Server 5.6\lib;" + $env:LIB
$env:PATH = "C:\Program Files\MySql\MySQL Server 5.6\bin;" + $env:PATH
if (Test-Path "C:\Program Files\MySql\MySQL Server 5.6\lib\libmysql.dlll") {
copy C:\Program Files\MySql\MySQL Server 5.6\lib\libmysql.dll C:\Program Files\MySql\MySQL Server 5.6\bin\libmysql.dll
$env:INCLUDE = $env:MYSQL64 + "\include;" + $env:INCLUDE
$env:LIB = $env:MYSQL64 + "\lib;" + $env:LIB
$env:PATH = $env:MYSQL64 + "\bin;" + $env:PATH
if (Test-Path ($env:MYSQL64 + "\lib\libmysql.dll")) {
copy i$env:MYSQL64 + "\lib\libmysql.dll $env:MYSQL64 + "\bin\libmysql.dll
}
& C:\cygwin\ls -lR "/cygwin/C/Program Files/MySql/MySQL Server 5.6"
& C:\cygwin\bin\ls -lR %MYSQL64%
}
$env:MYSQL_PWD="Password12!"
$cmd = 'mysql -e "create database pocotestdb;" --user=root';
@ -273,15 +270,15 @@ before_build:
- ps: |
if ($env:platform -eq "Win32")
{
$env:INCLUDE = "C:\Program Files (x86)\PostgreSQL\9.4\include;" + $env:INCLUDE
$env:LIB = "C:\Program Files (x86)\PostgreSQL\9.4\lib;" + $env:LIB
$env:PATH = "C:\Program Files (x86)\PostgreSQL\9.4\bin;" + $env:PATH
$env:INCLUDE = $env:POSTGRES32 + "\include;" + $env:INCLUDE
$env:LIB = $env:POSTGRES32 + "\lib;" + $env:LIB
$env:PATH = $env:POSTGRES32 + "\bin;" + $env:PATH
}
if ($env:platform -eq "x64")
{
$env:INCLUDE = "C:\Program Files\PostgreSQL\9.4\include;" + $env:INCLUDE
$env:LIB = "C:\Program Files\PostgreSQL\9.4\lib;" + $env:LIB
$env:PATH = "C:\Program Files\PostgreSQL\9.4\bin;" + $env:PATH
$env:INCLUDE = $env:POSTGRES64 + "\include;" + $env:INCLUDE
$env:LIB = $env:POSTGRES64 + "\lib;" + $env:LIB
$env:PATH = $env:POSTGRES64 + "\bin;" + $env:PATH
}
after_build: