Skip to content

Commit

Permalink
Simplify devcontainer. Test JDK 15Signed-off-by: Kai Zimmermann <kai.…
Browse files Browse the repository at this point in the history
…zimmermann@microsoft.com>
  • Loading branch information
kaizimmerm committed Nov 19, 2020
1 parent 9e8a923 commit bd83d2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
15 changes: 8 additions & 7 deletions .azure-pipelines/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@ variables:

jobs:
- job: JDK_11
displayName: Build with JDK-11 and SonarCloud analysis
displayName: Verify with JDK-11 and SonarCloud analysis
steps:
- template: rabbitmq-template.yml
- template: maven-template.yml
parameters:
mavenGoals: "package license:check -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=$(sonarCloudOrganization) -Dsonar.projectKey=$(sonarProjectKey)"
mavenGoals: "verify -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=$(sonarCloudOrganization) -Dsonar.projectKey=$(sonarProjectKey)"
jdkVersionOption: "1.11"
sonarQubeRunAnalysis: true
sonarCloudConnection: $(sonarCloudConnection)
sonarCloudOrganization: $(sonarCloudOrganization)
- job: JDK_8
displayName: Build with JDK-8
displayName: Build with JDK-8 (hawkBit default)
steps:
- template: maven-template.yml
parameters:
mavenGoals: "package license:check"
mavenGoals: "install license:check"
- job:
dependsOn: JDK_8
condition: succeeded()
Expand Down Expand Up @@ -91,14 +92,14 @@ jobs:
steps:
- template: rabbitmq-template.yml
- script: |
docker run --name mssql -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=1234567890. -d mcr.microsoft.com/mssql/server:$(dbVersion)
docker run --name mssql -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=1234567890.Ab -d mcr.microsoft.com/mssql/server:$(dbVersion)
until [ "`/usr/bin/docker inspect -f {{.State.Running}} mssql`" == "true" ]; do sleep 1; done
sleep 120
until docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "1234567890." -Q "CREATE DATABASE hawkbit"; do sleep 1; done
until docker exec mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "1234567890.Ab" -Q "CREATE DATABASE hawkbit"; do sleep 1; done
displayName: "Setup MSSQL Database docker instance"
- template: maven-template.yml
parameters:
mavenGoals: "verify -Dspring.jpa.database=SQL_SERVER -Dspring.datasource.url=jdbc:sqlserver://localhost:1433;database=hawkbit -Dspring.datasource.username=SA -Dspring.datasource.password=1234567890. -Dspring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver"
mavenGoals: "verify -Dspring.jpa.database=SQL_SERVER -Dspring.datasource.url=jdbc:sqlserver://localhost:1433;database=hawkbit -Dspring.datasource.username=SA -Dspring.datasource.password=1234567890.Ab -Dspring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver"
- job:
dependsOn: JDK_8
condition: succeeded()
Expand Down
21 changes: 3 additions & 18 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
# [Choice] Java version: 11, 15
ARG VARIANT=11
# [Choice] Java version: 8. 11, 15
ARG VARIANT=8
FROM mcr.microsoft.com/vscode/devcontainers/java:${VARIANT}

# [Option] Install Maven
ARG INSTALL_MAVEN="false"
ARG MAVEN_VERSION=""
# [Option] Install Gradle
ARG INSTALL_GRADLE="false"
ARG GRADLE_VERSION=""
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
RUN su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
9 changes: 2 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 11, 15
"VARIANT": "11",
// Options
"INSTALL_MAVEN": "true",
"INSTALL_GRADLE": "false",
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
// Update the VARIANT arg to pick a Java version: 8, 11, 15
"VARIANT": "8"
}
},
// Set *default* container specific settings.json values on container create.
Expand Down

0 comments on commit bd83d2d

Please sign in to comment.