From 1b647125244b7f453e6e2b384108a0cfe84210fa Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 14:07:06 -0500 Subject: [PATCH 1/6] Update action.yml --- .github/workflows/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index b54237a72f..ede1c47ed4 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -2,9 +2,9 @@ name: Deploy to Azure Spring Cloud with Key Vault on: [push] env: - AZURE_SUBSCRIPTION: 799c12ba-353c-44a1-883d-84808ebb2216 # customize this - SPRING_CLOUD_SERVICE: yuchensp # customize this - KEYVAULT: yuchenkv # customize this + AZURE_SUBSCRIPTION: f869415f-5cff-46a3-b728-20659d14d62d #customize + SPRING_CLOUD_SERVICE: springkv-eneros #customize + KEYVAULT: spring-cloud-eneros #customize # ==== APPS ====: API_GATEWAY: api-gateway ADMIN_SERVER: admin-server From 614955e30f42ffede6817b4deff60a73d92909b5 Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 14:08:02 -0500 Subject: [PATCH 2/6] Update action.yml --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index ede1c47ed4..e49762328d 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -2,7 +2,7 @@ name: Deploy to Azure Spring Cloud with Key Vault on: [push] env: - AZURE_SUBSCRIPTION: f869415f-5cff-46a3-b728-20659d14d62d #customize + AZURE_SUBSCRIPTION: f869415f-5cff-46a3-b728-20659d14d62d #customize/move to secrets SPRING_CLOUD_SERVICE: springkv-eneros #customize KEYVAULT: spring-cloud-eneros #customize # ==== APPS ====: From 6281487caddc052a6d17ea40b1af4eb0a3a1c258 Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 14:26:32 -0500 Subject: [PATCH 3/6] Update action.yml --- .github/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index e49762328d..b6e672d8bd 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,5 +1,5 @@ name: Deploy to Azure Spring Cloud with Key Vault -on: [push] +on: [push, workflow_dispatch] env: AZURE_SUBSCRIPTION: f869415f-5cff-46a3-b728-20659d14d62d #customize/move to secrets From a9b9e0ec114626a4eea0e6df1ba97fabb65caa00 Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 20:01:36 +0000 Subject: [PATCH 4/6] devcontainer --- .devcontainer/Dockerfile | 25 +++++++++++++++++ .devcontainer/devcontainer.json | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..f7f2f4843f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,25 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/java-8/.devcontainer/base.Dockerfile + +# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye +ARG VARIANT="bullseye" +FROM mcr.microsoft.com/vscode/devcontainers/java:0-8-${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 "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \ + && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi + +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 +ARG NODE_VERSION="lts/*" +RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment this line to install global node packages. +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..1c61562699 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,50 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/java-8 +{ + "name": "Java 8", + "runArgs": ["--init"], + "build": { + "dockerfile": "Dockerfile", + "args": { + // Use the VARIANT arg to pick a Debian OS version: buster, bullseye + // Use bullseye when running on local arm64/Apple Silicon. + "VARIANT": "buster", + // Options + "INSTALL_MAVEN": "true", + "INSTALL_GRADLE": "false", + "NODE_VERSION": "lts/*" + } + }, + + // Set *default* container specific settings.json values on container create. + "settings": { + "java.home": "/docker-java-home", + "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current", + "java.configuration.runtimes": [{ + "default": true, + "name": "JavaSE-1.8", + "path": "/usr/local/sdkman/candidates/java/current" + }] + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vscjava.vscode-java-pack" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "java -version", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "docker-in-docker": "latest", + "terraform": "latest", + "git": "latest", + "github-cli": "latest", + "azure-cli": "latest" + } +} From 4733a96fe8b4a3951db50cff97350c701a30956f Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 20:19:26 +0000 Subject: [PATCH 5/6] add tools --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/devcontainer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f7f2f4843f..02a015143f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -18,8 +18,8 @@ ARG NODE_VERSION="lts/*" RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi # [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends + RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends mariadb-client-core-10.3 jq # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1c61562699..ba5c46cddd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -36,7 +36,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "java -version", + "postCreateCommand": "az extension add --name spring-cloud", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", From ae1e0eb3731fbdd86589471053de1b6518f47294 Mon Sep 17 00:00:00 2001 From: Elena Neroslavskaya Date: Thu, 18 Nov 2021 21:35:26 +0000 Subject: [PATCH 6/6] codespaces changes --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dba91658fe..7f806f4b13 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ Then, set the environment: Login to the Azure CLI and choose your active subscription. Be sure to choose the active subscription that is whitelisted for Azure Spring Cloud ```bash - az login + az login # --use-device-code , if using codespaces az account list -o table az account set --subscription ${SUBSCRIPTION} ``` @@ -307,13 +307,15 @@ Create a MySQL database in Azure Database for MySQL. --server ${MYSQL_SERVER_NAME} \ --resource-group ${RESOURCE_GROUP} \ --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0 + + export MY_IP=$(curl -s http://whatismyip.akamai.com/) // allow access from your dev machine for testing az mysql server firewall-rule create --name devMachine \ --server ${MYSQL_SERVER_NAME} \ --resource-group ${RESOURCE_GROUP} \ - --start-ip-address \ - --end-ip-address + --start-ip-address $MY_IP \ + --end-ip-address $MY_IP // increase connection timeout az mysql server configuration set --name wait_timeout \