Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,14 @@ jobs:
Export-Certificate @params
certutil -encode $home/tmp-cert.cer $home/cosmosdbcert.cer
Remove-Item $home/tmp-cert.cer
& ${env:JAVA_HOME}/bin/keytool.exe -keystore ${env:JAVA_HOME}/jre/lib/security/cacerts -storepass 'changeit' -importcert -noprompt -alias cosmos_emulator -file $home/cosmosdbcert.cer
& ${env:JAVA_HOME}/bin/keytool.exe -keystore ${env:JAVA_HOME}/jre/lib/security/cacerts -storepass 'changeit' -list -alias cosmos_emulator
# Setting the keystore option differs between Java 8 and Java 11+
if ( ${env:INT_TEST_JAVA_RUNTIME_VERSION} -eq '8' ) {
$keystore = "-keystore", "${env:JAVA_HOME}/jre/lib/security/cacerts"
Copy link
Contributor Author

@Torch3333 Torch3333 Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$keystore = "-keystore", "${env:JAVA_HOME}/jre/lib/security/cacerts"
$keystore = "-keystore ${env:JAVA_HOME}/jre/lib/security/cacerts"

Writing this variable as a single string will not expand correctly in Powershell because it does not recognize -keystore as being an option for the keytool.exe command.
Instead, we need to separate the option from its value by storing it as an array in the $keystore variable.
It took me some time to figure it out 😓

} else {
$keystore = "-cacerts"
}
& ${env:JAVA_HOME}/bin/keytool.exe $keystore -storepass 'changeit' -importcert -noprompt -alias cosmos_emulator -file $home/cosmosdbcert.cer
& ${env:JAVA_HOME}/bin/keytool.exe $keystore -storepass 'changeit' -list -alias cosmos_emulator

- name: Setup and execute Gradle 'integrationTestCosmos' task
uses: gradle/gradle-build-action@v3
Expand Down