-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b6f3a0
commit 0e5db6a
Showing
6 changed files
with
176 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster | ||
ARG VARIANT=16-bullseye | ||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} | ||
|
||
# Install tslint, typescript. eslint is installed by javascript image | ||
ARG NODE_MODULES="tslint-to-eslint-config typescript" | ||
COPY library-scripts/meta.env /usr/local/etc/vscode-dev-containers | ||
RUN su node -c "umask 0002 && npm install -g ${NODE_MODULES}" \ | ||
&& npm cache clean --force > /dev/null 2>&1 | ||
|
||
# [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 if you want to install an additional version of node using nvm | ||
# ARG EXTRA_NODE_VERSION=10 | ||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
// 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.209.6/containers/javascript-node | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/typescript-node | ||
{ | ||
"name": "Node.js", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick a Node version: 16, 14, 12. | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local arm64/Apple Silicon. | ||
"args": { "VARIANT": "16" } | ||
}, | ||
"name": "Node.js & TypeScript", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick a Node version: 18, 16, 14. | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local on arm64/Apple Silicon. | ||
"args": { | ||
"VARIANT": "16-bullseye" | ||
} | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": {}, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"ms-azuretools.vscode-bicep" | ||
] | ||
} | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"ms-azuretools.vscode-bicep" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// 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": "yarn install", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "az bicep install", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node", | ||
"features": { | ||
"azure-cli": "latest" | ||
} | ||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node", | ||
"features": { | ||
"azure-cli": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,10 @@ env: | |
RESOURCE_GROUP: rg-blog-johnnyreilly-com | ||
LOCATION: westeurope | ||
STATICWEBAPPNAME: blog.johnnyreilly.com | ||
FUNCTIONAPPNAME: func-blog-johnnyreilly-com | ||
HOSTINGPLANNAME: ASP-rgblogjohnnyreillycom-a345 | ||
STORAGEACCOUNTNAME: stblogjohnnyreilly | ||
CUSTOMDOMAINNAME: blog.johnnyreilly.com | ||
TAGS: '{"owner":"johnnyreilly", "email":"[email protected]"}' | ||
|
||
jobs: | ||
|
@@ -109,10 +113,13 @@ jobs: | |
--parameters \ | ||
branch='main' \ | ||
location='${{ env.LOCATION }}' \ | ||
name='${{ env.STATICWEBAPPNAME }}' \ | ||
staticWebAppName='${{ env.STATICWEBAPPNAME }}' \ | ||
functionAppName='${{ env.FUNCTIONAPPNAME }}' \ | ||
hostingPlanName='${{ env.HOSTINGPLANNAME }}' \ | ||
storageAccountName='${{ env.STORAGEACCOUNTNAME }}' \ | ||
tags='${{ env.TAGS }}' \ | ||
repositoryToken='${{ secrets.WORKFLOW_TOKEN }}' \ | ||
customDomainName='${{ env.STATICWEBAPPNAME }}' | ||
customDomainName='${{ env.CUSTOMDOMAINNAME }}' | ||
- name: Static Web App - deploy infra | ||
id: static_web_app_deploy | ||
|
@@ -127,10 +134,13 @@ jobs: | |
--parameters \ | ||
branch='main' \ | ||
location='${{ env.LOCATION }}' \ | ||
name='${{ env.STATICWEBAPPNAME }}' \ | ||
staticWebAppName='${{ env.STATICWEBAPPNAME }}' \ | ||
functionAppName='${{ env.FUNCTIONAPPNAME }}' \ | ||
hostingPlanName='${{ env.HOSTINGPLANNAME }}' \ | ||
storageAccountName='${{ env.STORAGEACCOUNTNAME }}' \ | ||
tags='${{ env.TAGS }}' \ | ||
repositoryToken='${{ secrets.WORKFLOW_TOKEN }}' \ | ||
customDomainName='${{ env.STATICWEBAPPNAME }}' | ||
customDomainName='${{ env.CUSTOMDOMAINNAME }}' | ||
- name: Static Web App - get API key for deployment | ||
id: static_web_app_apikey | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
param functionAppName string | ||
param location string | ||
param hostingPlanName string | ||
param storageAccountName string | ||
param tags object | ||
|
||
resource functionApp 'Microsoft.Web/sites@2022-03-01' = { | ||
name: functionAppName | ||
kind: 'functionapp,linux' | ||
location: location | ||
tags: tags | ||
properties: { | ||
siteConfig: { | ||
appSettings: [ | ||
{ | ||
name: 'FUNCTIONS_EXTENSION_VERSION' | ||
value: '~4' | ||
} | ||
{ | ||
name: 'FUNCTIONS_WORKER_RUNTIME' | ||
value: 'node' | ||
} | ||
{ | ||
name: 'AzureWebJobsStorage' | ||
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' | ||
} | ||
{ | ||
name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING' | ||
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}' | ||
} | ||
{ | ||
name: 'WEBSITE_CONTENTSHARE' | ||
value: '${toLower(functionAppName)}a6e3' | ||
} | ||
] | ||
cors: { | ||
allowedOrigins: [ | ||
'https://portal.azure.com' | ||
] | ||
} | ||
use32BitWorkerProcess: false | ||
ftpsState: 'FtpsOnly' | ||
linuxFxVersion: 'Node|16' | ||
} | ||
serverFarmId: serverFarm.id | ||
clientAffinityEnabled: false | ||
httpsOnly: true | ||
} | ||
} | ||
|
||
resource serverFarm 'Microsoft.Web/serverfarms@2022-03-01' = { | ||
name: hostingPlanName | ||
location: location | ||
kind: 'linux' | ||
tags: {} | ||
properties: { | ||
reserved: true | ||
} | ||
sku: { | ||
tier: 'Dynamic' | ||
name: 'Y1' | ||
} | ||
dependsOn: [] | ||
} | ||
|
||
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-05-01' = { | ||
name: storageAccountName | ||
location: location | ||
tags: {} | ||
sku: { | ||
name: 'Standard_LRS' | ||
} | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
minimumTlsVersion: 'TLS1_2' | ||
} | ||
kind: 'StorageV2' | ||
} | ||
|
||
output functionAppResourceId string = functionApp.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters