0
J'essaye de lier une adresse dans le script PowerShell pour que mes testeurs puissent lancer des wiremocks et il pointe automatiquement vers l'environnement correct quand ils l'exécutent.J'essaye de lier une adresse dans le script PowerShell
echo "Running WireMock"
$WiremockFileName = "wiremock-standalone-2.1.12.jar"
$Port = 8050
$Address = "my.integration.address"
if (-not(Test-Path "./$WiremockFileName")) {
echo "Going to download wiremock";
Invoke-WebRequest "http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.1.12/$WiremockFileName" -OutFile $WiremockFileName
echo "Finished"
}
echo "Looking for JRE"
$JAVA = ""
if ($JAVA -eq "") {
# In case a specific version of Java is in the path already
$JavaExe = Get-Command "java" -ErrorAction SilentlyContinue
if ($JavaExe) {
$JAVA = JavaExe.Definition
}
}
if ($JAVA -eq "") {
# This seems to work on RBI machines
$jre7Path = "C:\Program Files (x86)\Java\jre7\bin\java.exe"
$testJre7 = Test-Path $jre7Path -ErrorAction SilentlyContinue
if ($testJre7) {
$JAVA = $jre7Path
}
}
if ($JAVA -eq "") {
# Nope - I give up
echo "I give up! I can't find JAVA anywhere"
echo "Put it in your path and stop giving me a hard time or send a pull request"
exit 1
# echo "Press any key to continue"
# $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
& $JAVA -jar $WiremockFileName --bind-address $Address --https-port $Port --verbose
exit $LASTEXITCODE
Je suis en train de faire ce travail partiel:
& $JAVA -jar $WiremockFileName --bind-address $Address --https-port $Port --verbose
mais --bind-address $Address
semble ne pas fonctionner.
"semble ne pas fonctionner" ... *Comment?* –