mirror of https://github.com/doccano/doccano.git
Hironsan
2 years ago
3 changed files with 0 additions and 408 deletions
Unified View
Diff Options
@ -1,54 +0,0 @@ |
|||||
trigger: |
|
||||
- master |
|
||||
|
|
||||
pool: |
|
||||
vmImage: 'ubuntu-latest' |
|
||||
|
|
||||
steps: |
|
||||
- script: docker build --tag=doccano --target=builder . |
|
||||
displayName: 'Run tests' |
|
||||
|
|
||||
- script: docker run doccano tar Ccf /doccano/app - junitxml | tar Cxf "$(Build.ArtifactStagingDirectory)" - |
|
||||
displayName: 'Export test results' |
|
||||
|
|
||||
- task: PublishTestResults@2 |
|
||||
inputs: |
|
||||
testResultsFormat: 'JUnit' |
|
||||
testResultsFiles: 'TEST-*.xml' |
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/junitxml' |
|
||||
mergeTestResults: true |
|
||||
testRunTitle: 'server.tests' |
|
||||
displayName: 'Publish test results' |
|
||||
|
|
||||
# To publish docker images to a container registry, set the following pipeline variables: |
|
||||
# - docker_password |
|
||||
# - docker_username |
|
||||
# - docker_registry (optional, set this to publish to a registry other than Docker Hub) |
|
||||
# |
|
||||
- script: DOCKER_PASSWORD="$(docker_password)" tools/cd.sh "azdo-$(Build.BuildId)" |
|
||||
displayName: 'Push docker image' |
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['docker_password'], '')) |
|
||||
|
|
||||
# To automatically deploy to Azure, create a service principal and set the following pipeline variables: |
|
||||
# - auth_username (app ID) |
|
||||
# - auth_tenant (tenant ID |
|
||||
# - auth_password (secret) |
|
||||
# |
|
||||
# Additionally, to configure the deployment, set the following pipeline variables: |
|
||||
# - doccano_admin_username |
|
||||
# - doccano_admin_password |
|
||||
# - doccano_admin_contact_email |
|
||||
# - doccano_app_name (globally unique name for the app) |
|
||||
# - doccano_secret_key (pass-through secret for Django) |
|
||||
# - doccano_resource_group (group for all resources, will be created if it doesn't yet exist) |
|
||||
# - doccano_location (name of the Azure region to which to deploy all resources) |
|
||||
# |
|
||||
- script: | |
|
||||
az login --service-principal --password "$(auth_password)" --tenant "$(auth_tenant)" --username "$(auth_username)" |
|
||||
|
|
||||
DOCCANO_ADMIN_PASSWORD="$(doccano_admin_password)" \ |
|
||||
DOCCANO_SECRET_KEY="$(doccano_secret_key)" \ |
|
||||
DOCKER_PASSWORD="$(docker_password)" \ |
|
||||
tools/azure.sh "azdo-$(Build.BuildId)" |
|
||||
displayName: 'Deploy to Azure' |
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['auth_password'], '')) |
|
@ -1,347 +0,0 @@ |
|||||
{ |
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
|
||||
"contentVersion": "1.0.0.0", |
|
||||
"parameters": { |
|
||||
"appName": { |
|
||||
"type": "string", |
|
||||
"minLength": 1, |
|
||||
"metadata": { |
|
||||
"description": "The name for the webapp. Must be globally unique." |
|
||||
} |
|
||||
}, |
|
||||
"secretKey": { |
|
||||
"type": "securestring", |
|
||||
"minLength": 16, |
|
||||
"metadata": { |
|
||||
"description": "The value to use as the Django secret key." |
|
||||
} |
|
||||
}, |
|
||||
"adminUserName": { |
|
||||
"type": "string", |
|
||||
"minLength": 1, |
|
||||
"metadata": { |
|
||||
"description": "The user name for the admin account." |
|
||||
} |
|
||||
}, |
|
||||
"adminContactEmail": { |
|
||||
"type": "string", |
|
||||
"minLength": 1, |
|
||||
"metadata": { |
|
||||
"description": "The contact email address for the admin account." |
|
||||
} |
|
||||
}, |
|
||||
"adminPassword": { |
|
||||
"type": "securestring", |
|
||||
"minLength": 16, |
|
||||
"maxLength": 50, |
|
||||
"metadata": { |
|
||||
"description": "The password for the admin account." |
|
||||
} |
|
||||
}, |
|
||||
"appServiceSku": { |
|
||||
"type": "string", |
|
||||
"defaultValue": "B2", |
|
||||
"allowedValues": [ |
|
||||
"B1", |
|
||||
"B2", |
|
||||
"B3", |
|
||||
"S1", |
|
||||
"S2", |
|
||||
"S3" |
|
||||
], |
|
||||
"metadata": { |
|
||||
"description": "The SKU of the webapp hosting tier." |
|
||||
} |
|
||||
}, |
|
||||
"sendgridSku": { |
|
||||
"type": "string", |
|
||||
"defaultValue": "free", |
|
||||
"allowedValues": [ |
|
||||
"free", |
|
||||
"bronze", |
|
||||
"silver", |
|
||||
"gold", |
|
||||
"platinum", |
|
||||
"premier" |
|
||||
], |
|
||||
"metadata": { |
|
||||
"description": "The SKU of the Sendgrid email account." |
|
||||
} |
|
||||
}, |
|
||||
"databaseCores": { |
|
||||
"type": "int", |
|
||||
"defaultValue": 2, |
|
||||
"allowedValues": [ |
|
||||
2, |
|
||||
4, |
|
||||
8, |
|
||||
16, |
|
||||
32, |
|
||||
64 |
|
||||
], |
|
||||
"metadata": { |
|
||||
"description": "The number of vCores to provision for the PostgreSQL server." |
|
||||
} |
|
||||
}, |
|
||||
"databaseSize": { |
|
||||
"type": "int", |
|
||||
"minValue": 51200, |
|
||||
"defaultValue": 51200, |
|
||||
"metadata": { |
|
||||
"description": "The storage capacity to provision for the PostgreSQL server." |
|
||||
} |
|
||||
}, |
|
||||
"databaseName": { |
|
||||
"type": "string", |
|
||||
"minLength": 1, |
|
||||
"defaultValue": "doccano", |
|
||||
"metadata": { |
|
||||
"description": "The name of the database to provision on the PostgreSQL server." |
|
||||
} |
|
||||
}, |
|
||||
"dockerImageName": { |
|
||||
"type": "string", |
|
||||
"minLength": 1, |
|
||||
"defaultValue": "doccano/doccano:latest", |
|
||||
"metadata": { |
|
||||
"description": "The Docker image to deploy." |
|
||||
} |
|
||||
}, |
|
||||
"dockerRegistry": { |
|
||||
"type": "string", |
|
||||
"defaultValue": "", |
|
||||
"metadata": { |
|
||||
"description": "The registry of the Docker image." |
|
||||
} |
|
||||
}, |
|
||||
"dockerRegistryUserName": { |
|
||||
"type": "string", |
|
||||
"defaultValue": "", |
|
||||
"metadata": { |
|
||||
"description": "The user name for the Docker registry." |
|
||||
} |
|
||||
}, |
|
||||
"dockerRegistryPassword": { |
|
||||
"type": "securestring", |
|
||||
"defaultValue": "", |
|
||||
"metadata": { |
|
||||
"description": "The password for the Docker registry." |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"variables": { |
|
||||
"location": "[resourceGroup().location]", |
|
||||
"databaseSkuTier": "GeneralPurpose", |
|
||||
"databaseSkuFamily": "Gen5", |
|
||||
"databaseSkuName": "[concat('GP_', variables('databaseSkuFamily'), '_', parameters('databaseCores'))]", |
|
||||
"databaseVersion": "9.6", |
|
||||
"databaseServerPort": 5432, |
|
||||
"databaseServerName": "[concat(parameters('appName'),'-state')]", |
|
||||
"databaseUserCredentials" : "[concat(uriComponent(concat(parameters('adminUserName'), '@', variables('databaseServerName'))), ':', parameters('adminPassword'))]", |
|
||||
"databaseFqdn" : "[concat( variables('databaseServerName'), '.postgres.database.azure.com:', variables('databaseServerPort'))]", |
|
||||
"databaseConnectionString": "[concat('pgsql://', variables('databaseUserCredentials'), '@', variables('databaseFqdn'), '/', parameters('databaseName'))]", |
|
||||
"sendgridAccountName": "[concat(parameters('appName'),'-email')]", |
|
||||
"appServicePlanName": "[concat(parameters('appName'),'-hosting')]", |
|
||||
"analyticsName": "[concat(parameters('appName'),'-analytics')]", |
|
||||
"appFqdn": "[concat(parameters('appName'),'.azurewebsites.net')]" |
|
||||
}, |
|
||||
"resources": [ |
|
||||
{ |
|
||||
"name": "[variables('sendgridAccountName')]", |
|
||||
"type": "Sendgrid.Email/accounts", |
|
||||
"apiVersion": "2015-01-01", |
|
||||
"location": "[variables('location')]", |
|
||||
"plan": { |
|
||||
"name": "[parameters('sendgridSku')]", |
|
||||
"publisher": "Sendgrid", |
|
||||
"product": "sendgrid_azure", |
|
||||
"promotionCode": "" |
|
||||
}, |
|
||||
"properties": { |
|
||||
"acceptMarketingEmails": false, |
|
||||
"email": "[parameters('adminContactEmail')]", |
|
||||
"password": "[parameters('adminPassword')]" |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"type": "Microsoft.Insights/components", |
|
||||
"apiVersion": "2015-05-01", |
|
||||
"name": "[variables('analyticsName')]", |
|
||||
"location": "[variables('location')]", |
|
||||
"tags": {}, |
|
||||
"kind": "web", |
|
||||
"properties": { |
|
||||
"Application_Type": "web" |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"apiVersion": "2017-08-01", |
|
||||
"type": "Microsoft.Web/serverfarms", |
|
||||
"kind": "linux", |
|
||||
"name": "[variables('appServicePlanName')]", |
|
||||
"location": "[variables('location')]", |
|
||||
"properties": { |
|
||||
"reserved": true |
|
||||
}, |
|
||||
"dependsOn": [], |
|
||||
"sku": { |
|
||||
"name": "[parameters('appServiceSku')]" |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
"apiVersion": "2017-12-01", |
|
||||
"type": "Microsoft.DBforPostgreSQL/servers", |
|
||||
"location": "[variables('location')]", |
|
||||
"name": "[variables('databaseServerName')]", |
|
||||
"sku": { |
|
||||
"name": "[variables('databaseSkuName')]", |
|
||||
"tier": "[variables('databaseSkuTier')]", |
|
||||
"family": "[variables('databaseSkuFamily')]", |
|
||||
"capacity": "[parameters('databaseCores')]", |
|
||||
"size": "[parameters('databaseSize')]" |
|
||||
}, |
|
||||
"properties": { |
|
||||
"version": "[variables('databaseVersion')]", |
|
||||
"administratorLogin": "[parameters('adminUserName')]", |
|
||||
"administratorLoginPassword": "[parameters('adminPassword')]", |
|
||||
"storageMB": "[parameters('databaseSize')]" |
|
||||
}, |
|
||||
"resources": [ |
|
||||
{ |
|
||||
"name": "allowAzure", |
|
||||
"type": "firewallrules", |
|
||||
"apiVersion": "2017-12-01", |
|
||||
"location": "[variables('location')]", |
|
||||
"properties": { |
|
||||
"startIpAddress": "0.0.0.0", |
|
||||
"endIpAddress": "0.0.0.0" |
|
||||
}, |
|
||||
"dependsOn": [ |
|
||||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]" |
|
||||
] |
|
||||
}, |
|
||||
{ |
|
||||
"name": "[parameters('databaseName')]", |
|
||||
"type": "databases", |
|
||||
"apiVersion": "2017-12-01", |
|
||||
"properties": { |
|
||||
"charset": "utf8", |
|
||||
"collation": "English_United States.1252" |
|
||||
}, |
|
||||
"dependsOn": [ |
|
||||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]" |
|
||||
] |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
{ |
|
||||
"type": "Microsoft.Web/sites", |
|
||||
"apiVersion": "2016-08-01", |
|
||||
"name": "[parameters('appName')]", |
|
||||
"kind": "app,linux,container", |
|
||||
"location": "[variables('location')]", |
|
||||
"dependsOn": [ |
|
||||
"[resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))]", |
|
||||
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('databaseServerName'))]", |
|
||||
"[resourceId('Microsoft.Insights/components', variables('analyticsName'))]", |
|
||||
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" |
|
||||
], |
|
||||
"properties": { |
|
||||
"name": "[parameters('appName')]", |
|
||||
"siteConfig": { |
|
||||
"linuxFxVersion": "[concat('DOCKER|', parameters('dockerImageName'))]", |
|
||||
"alwaysOn": true, |
|
||||
"appSettings": [ |
|
||||
{ |
|
||||
"name": "WEBSITES_PORT", |
|
||||
"value": "8000" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "PORT", |
|
||||
"value": "8000" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", |
|
||||
"value": "false" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "DOCKER_REGISTRY_SERVER_URL", |
|
||||
"value": "[parameters('dockerRegistry')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "DOCKER_REGISTRY_SERVER_USERNAME", |
|
||||
"value": "[parameters('dockerRegistryUserName')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "DOCKER_REGISTRY_SERVER_PASSWORD", |
|
||||
"value": "[parameters('dockerRegistryPassword')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "AZURE_APPINSIGHTS_IKEY", |
|
||||
"value": "[reference(resourceId('Microsoft.Insights/components', variables('analyticsName')), '2014-04-01').InstrumentationKey]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "GOOGLE_TRACKING_ID", |
|
||||
"value": " " |
|
||||
}, |
|
||||
{ |
|
||||
"name": "ADMIN_USERNAME", |
|
||||
"value": "[parameters('adminUserName')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "ADMIN_EMAIL", |
|
||||
"value": "[parameters('adminContactEmail')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "ADMIN_PASSWORD", |
|
||||
"value": "[parameters('adminPassword')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "EMAIL_USE_TLS", |
|
||||
"value": "True" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "EMAIL_HOST", |
|
||||
"value": "[reference(resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))).smtpServer]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "EMAIL_HOST_USER", |
|
||||
"value": "[reference(resourceId('Sendgrid.Email/accounts', variables('sendgridAccountName'))).username]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "EMAIL_HOST_PASSWORD", |
|
||||
"value": "[parameters('adminPassword')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "EMAIL_PORT", |
|
||||
"value": "587" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "DEBUG", |
|
||||
"value": "False" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "SECRET_KEY", |
|
||||
"value": "[parameters('secretKey')]" |
|
||||
}, |
|
||||
{ |
|
||||
"name": "DATABASE_URL", |
|
||||
"value": "[variables('databaseConnectionString')]" |
|
||||
} |
|
||||
] |
|
||||
}, |
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
"outputs": { |
|
||||
"appServer": { |
|
||||
"type": "string", |
|
||||
"value": "[concat(variables('appFqdn'))]" |
|
||||
}, |
|
||||
"databaseServer": { |
|
||||
"type": "string", |
|
||||
"value": "[variables('databaseFqdn')]" |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,7 +0,0 @@ |
|||||
steps: |
|
||||
- name: 'gcr.io/cloud-builders/docker' |
|
||||
args: ['build', '--tag=gcr.io/${PROJECT_ID}/almeta-doccano:${BRANCH_NAME}', '.'] |
|
||||
- name: 'gcr.io/cloud-builders/docker' |
|
||||
args: ["push", "gcr.io/${PROJECT_ID}/almeta-doccano:${BRANCH_NAME}"] |
|
||||
- name: 'gcr.io/cloud-builders/gcloud' |
|
||||
args: ['beta', 'run', 'deploy', 'almeta-doccano', '--image', 'gcr.io/${PROJECT_ID}/almeta-doccano:${BRANCH_NAME}', '--region', 'us-central1', '--memory', '2G', '--platform', 'managed', '--allow-unauthenticated'] |
|
Write
Preview
Loading…
Cancel
Save