Skip to content

Commit

Permalink
use no cache
Browse files Browse the repository at this point in the history
  • Loading branch information
vhvb1989 committed Jan 5, 2024
1 parent 529da89 commit 4050a71
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 62 deletions.
18 changes: 13 additions & 5 deletions templates/todo/projects/csharp-cosmos-sql/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/csharp-cosmos-sql
language: csharp
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/csharp-sql-swa-func/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: staticwebapp
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/csharp-sql-func
language: dotnet
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/csharp-sql/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/csharp-sql
language: csharp
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/java-mongo/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/java
language: java
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/java-postgresql/.repo/terraform/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/java
language: java
Expand Down
19 changes: 12 additions & 7 deletions templates/todo/projects/nodejs-mongo-aks/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ services:
dist: dist
language: js
host: aks
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
shell: sh
run: azd env set REACT_APP_WEB_BASE_URL ${SERVICE_WEB_ENDPOINT_URL}
windows:
shell: pwsh
run: 'azd env set REACT_APP_WEB_BASE_URL ${SERVICE_WEB_ENDPOINT_URL} ; rm .env.local'
posix:
shell: sh
run: 'azd env set REACT_APP_WEB_BASE_URL ${SERVICE_WEB_ENDPOINT_URL} && rm .env.local'
api:
project: ../../api/js
language: js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: staticwebapp
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/js
language: js
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/nodejs-mongo/.repo/bicep/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/js
language: js
Expand Down
18 changes: 13 additions & 5 deletions templates/todo/projects/nodejs-mongo/.repo/terraform/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@ services:
dist: dist
language: js
host: appservice
# Do not hold the package output, for deploy, during azd up.
noCache: true
hooks:
# When azd runs package, the static-web-app-required .env-values (from azd env) are not visible to `npm run build`.
# This hook creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# Creates a temporary `.env.local` file for the build command. Vite will automatically use it during build.
# The expected/required values are mapped to the infrastructure outputs.
# .env.local is ignored by git, so it will not be committed if for any reason the hook does not remove it at the end.
# .env.local is ignored by git, so it will not be committed if, for any reason, if deployment fails.
# see: https://vitejs.dev/guide/env-and-mode
# Note: Notice that dotenv must be a project dependency for this to work. See package.json.
predeploy:
windows:
shell: pwsh
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local ; npm run build; rm .env.local'
run: 'echo "VITE_API_BASE_URL=\"$env:API_BASE_URL\"" > .env.local ; echo "VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$env:APPLICATIONINSIGHTS_CONNECTION_STRING\"" >> .env.local'
posix:
shell: sh
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local && npm install && npm run build && rm .env.local'
run: 'echo VITE_API_BASE_URL=\"$API_BASE_URL\" > .env.local && echo VITE_APPLICATIONINSIGHTS_CONNECTION_STRING=\"$APPLICATIONINSIGHTS_CONNECTION_STRING\" >> .env.local'
postdeploy:
windows:
shell: pwsh
run: 'rm .env.local'
posix:
shell: sh
run: 'rm .env.local'
api:
project: ../../api/js
language: js
Expand Down
Loading

0 comments on commit 4050a71

Please sign in to comment.