first commit

parents
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
@echo off
echo loading environment ...
set PROJECT_ENV_REPO_REL_PATH=git\environment
call %PROJECT_ENV_REPO_REL_PATH%\projectVariables-gbe64.bat configOthers
echo environment loaded
cmd /k echo Cmd configured for %CURRENT_DIR% project
@echo off
echo loading environment ...
set PROJECT_ENV_REPO_REL_PATH=git\environment
call %PROJECT_ENV_REPO_REL_PATH%\projectVariables-gbe64.bat configOthers
echo environment loaded
set VAGRANT_CWD=%CURRENT_DIR%\git\k03_2
rem https://superuser.com/questions/489240/how-to-get-filename-only-without-path-in-windows-command-line
set FILENAME=%~n0
set VAGRANT_CONFIG=%CURRENT_DIR%\%FILENAME%.yml
echo "The VAGRANT_CWD is equal to %VAGRANT_CWD%"
cmd /k echo "The VAGRANT_CONFIG is equal to %VAGRANT_CONFIG%"
@echo off
echo loading environment ...
set PROJECT_ENV_REPO_REL_PATH=git\environment
call %PROJECT_ENV_REPO_REL_PATH%\projectVariables-gbe64.bat configOthers
echo environment loaded
set VAGRANT_CWD=%CURRENT_DIR%\git\p03_2
rem https://superuser.com/questions/489240/how-to-get-filename-only-without-path-in-windows-command-line
set FILENAME=%~n0
set VAGRANT_CONFIG=%CURRENT_DIR%\%FILENAME%.yml
echo "The VAGRANT_CWD is equal to %VAGRANT_CWD%"
cmd /k echo "The VAGRANT_CONFIG is equal to %VAGRANT_CONFIG%"
@echo off
echo loading environment ...
set PROJECT_ENV_REPO_REL_PATH=git\environment
call %PROJECT_ENV_REPO_REL_PATH%\projectVariables-gbe64.bat configOthers
echo environment loaded
set VAGRANT_CWD=%CURRENT_DIR%\git\p04_1
rem https://superuser.com/questions/489240/how-to-get-filename-only-without-path-in-windows-command-line
set FILENAME=%~n0
set VAGRANT_CONFIG=%CURRENT_DIR%\%FILENAME%.yml
echo "The VAGRANT_CWD is equal to %VAGRANT_CWD%"
cmd /k echo "The VAGRANT_CONFIG is equal to %VAGRANT_CONFIG%"
@echo off
rem we check de powershell version if lower that 3 exit
for /f %%i in ('powershell -Command "$PSVersionTable.PSVersion.Major"') do set powershellVersion=%%i
echo powershellVersion=%powershellVersion%
if %powershellVersion% LSS 3 (
echo Only works with powershell greater or equal to 3
goto end
)
rem we download the setup package
IF "%VBOX_VERSION%" == "" (
set VBOX_VERSION=5.1.22
echo Defaults VBOX_VERSION=%VBOX_VERSION%
)
echo VBOX_VERSION=%VBOX_VERSION%
set downloadAllUrl=https://download.virtualbox.org/virtualbox/%VBOX_VERSION%
Set POWERSHELL_COMMAND="$url='%downloadAllUrl%';$content = wget -Uri $url;$line=(($content.allelements | ? href).innerText -match '.*\-Win.exe');$line[0] -match '.*\-(\d{6})-Win.exe' | out-null;Write-Output $Matches[1]"
for /f %%i in (' powershell -Command %POWERSHELL_COMMAND% ') do set VBOX_VERSION_RELEASE=%%i
echo "downloading %VBOX_VERSION% release %VBOX_VERSION_RELEASE%"
set downloadUrl=https://download.virtualbox.org/virtualbox/%VBOX_VERSION%/VirtualBox-%VBOX_VERSION%-%VBOX_VERSION_RELEASE%-Win.exe
mkdir downloads 2> nul
for /f %%i in ('powershell -Command "$(split-path -path "%downloadUrl%" -leaf)"') do set appFileName=%%i
echo appFileName=%appFileName%
if Not exist "downloads\%appFileName%" (
rem file exists
echo downloading %downloadUrl% to downloads
rem we escape because we are inside if
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %downloadUrl% -OutFile downloads\%appFileName%"
)
:end
This diff is collapsed.
@echo off
SET ChocolateyInstall=%CURRENT_DIR%\chocolatey64
mkdir %ChocolateyInstall%
:: the next script raises a https://community.spiceworks.com/topic/1763974-set-powershell-script-as-trusted
:: All install options - offline, proxy, etc at
:: https://chocolatey.org/install
:: @powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%ChocolateyInstall%\bin"
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) "
::call chocolatey64\bin\choco install puppet-agent.portable -y
::call chocolatey64\bin\choco feature disable --name=showNonElevatedWarnings
:end
@echo off
rem we check de powershell version if lower that 3 exit
for /f %%i in ('powershell -Command "$PSVersionTable.PSVersion.Major"') do set powershellVersion=%%i
echo powershellVersion=%powershellVersion%
if %powershellVersion% LSS 3 (
echo Only works with powershell greater or equal to 3
goto end
)
rem we download the setup package
set downloadUrl=https://cygwin.com/setup-x86_64.exe
mkdir downloads 2> nul
for /f %%i in ('powershell -Command "$(split-path -path "%downloadUrl%" -leaf)"') do set appFileName=%%i
echo appFileName=%appFileName%
rem The CMD shell does not use any great intelligence when evaluating parenthesis, and we have parenthesis in the inner command
if Not exist "downloads\%appFileName%" (
rem file exists
echo downloading %downloadUrl% to downloads
rem we escape because we are inside if
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %downloadUrl% -OutFile downloads\%appFileName%"
)
rem we install cygwin
set CYGWIN_HOME_REL_PATH=cygwin64
mkdir %CYGWIN_HOME_REL_PATH% 2> nul
echo installing cygwin
set packages=rsync,zip,unzip,wget,curl,openssh,openssl,xmlstarlet,jq,bind-utils,inetutils,git,mysql
rem rsync,zip,unzip,wget,curl,openssh,openssl,xmlstarlet,jq,bind-utils,inetutils,git …
downloads\setup-x86_64.exe --no-admin --quiet-mode --no-startmenu --no-desktop --no-shortcuts --force-current --local-package-dir "%CD%\downloads" --root "%CD%\%CYGWIN_HOME_REL_PATH%" --site "http://cygwin.mirror.constant.com/" --packages %packages%
rem we fix the fstab
cygwin64\bin\sed -i "s\,user \,user,noacl \g" cygwin64\etc\fstab
rem we setup PATH
set CYGWIN_HOME=%CD%\%CYGWIN_HOME_REL_PATH%
set CYGWIN_PATH=%CYGWIN_HOME%\bin
echo The Current Dir is equal to %CD%
echo The CYGWIN_HOME is equal to %CYGWIN_HOME%
echo The CYGWIN_HOME_REL_PATH is equal to %CYGWIN_HOME_REL_PATH%
echo %PATH% | %WINDIR%\System32\find.exe "%CYGWIN_PATH%" /C >NUL
IF NOT ERRORLEVEL 1 GOTO pathDuplicate
SET PATH=%CYGWIN_PATH%;%PATH%
echo PATH has been updated PATH = %PATH%
:pathDuplicate
:end
@echo off
rem we check vbox existance
if "%VBOX_MSI_INSTALL_PATH%" == "" (
echo Requires Virtual Box
goto end
)
rem we check de powershell version if lower that 3 exit
for /f %%i in ('powershell -Command "$PSVersionTable.PSVersion.Major"') do set powershellVersion=%%i
echo powershellVersion=%powershellVersion%
if %powershellVersion% LSS 3 (
echo Only works with powershell greater or equal to 3
goto end
)
rem we download the setup package
IF "%VAGRANT_VERSION%" == "" (
set VAGRANT_VERSION=2.2.3
echo Defaults VAGRANT_VERSION=%VAGRANT_VERSION%
)
echo "downloading %VAGRANT_VERSION%"
set downloadUrl=https://releases.hashicorp.com/vagrant/%VAGRANT_VERSION%/vagrant_%VAGRANT_VERSION%_x86_64.msi
mkdir downloads 2> nul
for /f %%i in ('powershell -Command "$(split-path -path "%downloadUrl%" -leaf)"') do set appFileName=%%i
echo appFileName=%appFileName%
if Not exist "downloads\%appFileName%" (
rem file exists
echo downloading %downloadUrl% to downloads
rem we escape because we are inside if
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest %downloadUrl% -OutFile downloads\%appFileName%"
)
rem we install app
set APP_HOME_REL_PATH=vagrant64
mkdir %APP_HOME_REL_PATH% 2> nul
msiexec.exe /a "downloads\%appFileName%" /qb TARGETDIR=%CD%\%APP_HOME_REL_PATH%
:end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment