AzureStaticWebApp@0 - Azure Static Web App v0-taak implementeren
Met deze taak wordt een Statische Azure-web-app gebouwd en geïmplementeerd.
Syntaxis
# Deploy Azure Static Web App v0
# Build and deploy an Azure Static Web App.
- task: AzureStaticWebApp@0
inputs:
#workingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd | rootDirectory. Working directory. Default: $(System.DefaultWorkingDirectory).
#app_location: # string. App location.
#app_build_command: # string. App build command.
#output_location: # string. Output location.
#api_location: # string. Api location.
#api_build_command: # string. Api build command.
#routes_location: # string. Routes location.
#config_file_location: # string. Config file location.
#skip_app_build: # boolean. Skip app build.
#skip_api_build: # boolean. Skip api build.
#is_static_export: # boolean. Set static export.
#verbose: # boolean. Verbose.
#build_timeout_in_minutes: # string. Build timeout in minutes.
#azure_static_web_apps_api_token: # string. Azure Static Web Apps api token.
#deployment_environment: # string. Deployment Environment.
#production_branch: # string. Production Branch.
#data_api_location: # string. Data api location.
# Deploy Azure Static Web App v0
# Build and deploy an Azure Static Web App.
- task: AzureStaticWebApp@0
inputs:
#workingDirectory: '$(System.DefaultWorkingDirectory)' # string. Alias: cwd | rootDirectory. Working directory. Default: $(System.DefaultWorkingDirectory).
#app_location: # string. App location.
#app_build_command: # string. App build command.
#output_location: # string. Output location.
#api_location: # string. Api location.
#api_build_command: # string. Api build command.
#routes_location: # string. Routes location.
#config_file_location: # string. Config file location.
#skip_app_build: # boolean. Skip app build.
#skip_api_build: # boolean. Skip api build.
#is_static_export: # boolean. Set static export.
#verbose: # boolean. Verbose.
#build_timeout_in_minutes: # string. Build timeout in minutes.
#azure_static_web_apps_api_token: # string. Azure Static Web Apps api token.
#deployment_environment: # string. Deployment Environment.
#production_branch: # string. Production Branch.
Ingangen
workingDirectory
-
werkmap
Invoeralias: cwd | rootDirectory
.
string
. Standaardwaarde: $(System.DefaultWorkingDirectory)
.
Hiermee geeft u de absolute werkmap waarin deze taak moet worden uitgevoerd. Als deze leeg blijft, wordt de standaardwerkmap gebruikt.
app_location
-
app-locatie
string
.
De maplocatie van de broncode van de toepassing ten opzichte van de werkmap. Wanneer deze waarde wordt gebruikt met skip_app_build: true
, is deze waarde de uitvoerlocatie van de build van de app.
app_build_command
-
app-buildopdracht
string
.
De aangepaste opdracht die wordt gebruikt om Oryx uit te voeren bij het bouwen van de broncode van de toepassing.
output_location
-
uitvoerlocatie
string
.
De maplocatie van de gecompileerde toepassingscode nadat het bouwen is voltooid, ten opzichte van de werkmap. Stel deze een lege tekenreeks (''
) in bij het omzeilen van automatische build en alleen implementeren is vereist.
api_location
-
API-locatie
string
.
De maplocatie van de Azure Functions-broncode ten opzichte van de werkmap.
api_build_command
-
api-buildopdracht
string
.
De aangepaste opdracht die wordt gebruikt om Oryx uit te voeren bij het bouwen van Azure Functions-broncode.
locatie van routes_location
- routes
string
.
De maplocatie van het routes.json-bestand ten opzichte van de werkmap.
Opmerking: Routes.json is afgeschaft. Gebruik staticwebapp.config.json.
config_file_location
-
locatie van configuratiebestand
string
.
De maplocatie van het staticwebapp.config.json-bestand ten opzichte van de werkmap.
skip_app_build
-
App-build overslaan
boolean
.
Slaat Oryx-build voor de app-map over.
skip_api_build
-
API-build overslaan
boolean
.
Slaat Oryx-build voor de API-map over.
is_static_export
-
statische export instellen
boolean
.
Stel deze vlag in op true
wanneer uw toepassing is geconfigureerd om te exporteren naar statische HTML, bijvoorbeeld wanneer u next export
gebruikt.
Wanneer deze vlag is ingesteld op true
uitgebreide
boolean
.
Hiermee schakelt u uitgebreide logboekregistratie in.
time-out voor build_timeout_in_minutes
- build in minuten
string
.
Hiermee geeft u de tijdslimiet van de map Oryx-app-build in minuten op.
azure_static_web_apps_api_token
-
Api-token van Azure Static Web Apps
string
.
Hiermee geeft u het API-token voor implementatie.
Opmerking: niet vereist als deze als omgevingsvariabele wordt doorgegeven.
deployment_environment
-
implementatieomgeving
string
.
Hiermee geeft u de omgeving op waarin moet worden geïmplementeerd. Laat leeg voor de productieomgeving. Deze invoer heeft voorrang op de productievertakking.
production_branch
-
productiebranch
string
.
Hiermee geeft u de productiebranch op. Wanneer de implementatieomgeving is gedefinieerd en de implementatieomgeving leeg is, zijn implementaties van andere vertakkingen preview-omgevingen.
locatie van data_api_location
- Data-API
string
.
Maplocatie van de gegevens-API-bronbestanden ten opzichte van werkmap.
Opties voor taakbeheer
Alle taken hebben besturingsopties naast hun taakinvoer. Zie Opties en algemene taakeigenschappenvoor meer informatie.
Uitvoervariabelen
Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.
AZURESTATICWEBAPP_STATIC_WEB_APP_URL
URL van de statische web-app na een geslaagde implementatie.
Opmerkingen
Notitie
Deze taak wordt alleen uitgevoerd op Linux-agents.
Voorbeelden
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
submodules: true
- task: AzureStaticWebApp@0
inputs:
app_location: '/build'
api_location: 'api'
output_location: '/output'
azure_static_web_apps_api_token: $(deployment_token)
De front-end-app overslaan en alleen implementeren uitvoeren
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
displayName: 'dependencies install and distribution build'
- task: AzureStaticWebApp@0
inputs:
app_location : '/dist'
output_location: '' # Leave this empty
skip_app_build: true
skip_api_build: true
azure_static_web_apps_api_token: $(deployment_token)
Eisen
Eis | Beschrijving |
---|---|
Pijplijntypen | YAML, klassieke build, klassieke release |
Wordt uitgevoerd op | Agent, DeploymentGroup |
eisen | Geen |
mogelijkheden | Deze taak voldoet niet aan de vereisten voor volgende taken in de taak. |
opdrachtbeperkingen | Enig |
variabelen instellen | Enig |
Agentversie | 1.95.0 of hoger |
Taakcategorie | Nut |