Commit 58a186b6 authored by Daniel Scholl's avatar Daniel Scholl
Browse files

Merge branch 'azure' into 'master'

Azure

See merge request !3
parents 4eff318f f61228b4
Pipeline #1619 passed with stages
in 22 minutes and 58 seconds
variables:
AZURE_SERVICE: entitlements
AZURE_OSDU_TENANT: opendes
AZURE_COMPANY_DOMAIN: contoso.com
AZURE_VALID_GROUPNAME: integ.test.data.creator
AZURE_INVALID_GROUPNAME: InvalidTestAdmin
AZURE_BUILD_SUBDIR: ./
AZURE_TEST_SUBDIR: integration-tests
include:
- project: 'osdu/platform/ci-cd-pipelines'
ref: 'master'
file: 'standard-setup.yml'
- project: 'osdu/platform/ci-cd-pipelines'
ref: 'master'
file: 'build/maven.yml'
- project: 'osdu/platform/ci-cd-pipelines'
ref: 'master'
file: 'cloud-providers/azure.yml'
\ No newline at end of file
- project: "osdu/platform/ci-cd-pipelines"
ref: "master"
file: "standard-setup.yml"
- project: "osdu/platform/ci-cd-pipelines"
ref: "master"
file: "build/maven.yml"
- project: "osdu/platform/ci-cd-pipelines"
ref: "master"
file: "cloud-providers/azure.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "scanners/fossa.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "scanners/gitlab-ultimate.yml"
......@@ -166,8 +166,9 @@ As of now, the management APIs that enable user entitlements to be configured ar
## Deploying the Service
Service deployments into Azure are standardized to make the process the same for all services if using ADO. The steps to deploy into
Azure can be [found here](https://github.com/Azure/osdu-infrastructure/blob/master/docs/osdu/SERVICE_DEPLOYMENTS.md)
Service deployments into Azure are standardized to make the process the same for all services if using ADO and are closely related to the infrastructure deployed. The steps to deploy into Azure can be [found here](https://github.com/azure/osdu-infrastructure)
The default ADO pipeline is /devops/azure-pipelines.yml
### Manual Deployment Steps
......@@ -193,6 +194,8 @@ export AZURE_INVALID_JWT=""
# Pipeline Level Variable
export AZURE_SERVICE="entitlements"
export AZURE_BUILD_SUBDIR="."
export AZURE_TEST_SUBDIR="integration-tests"
export AZURE_OSDU_TENANT="opendes"
export AZURE_COMPANY_DOMAIN="contoso.com"
export AZURE_VALID_GROUPNAME="integ.test.data.creator"
......@@ -226,11 +229,12 @@ __Azure Service Deployment__
1. Deploy the service using the Maven Plugin _(azure_deploy)_
```bash
mvn --settings .mvn/community-maven.settings.xml azure-webapp:deploy \
-DAZURE_TENANT_ID=$AZURE_TENANT_ID \
cd $AZURE_BUILD_SUBDIR
mvn azure-webapp:deploy \
-DAZURE_DEPLOY_TENANT=$AZURE_TENANT_ID \
-Dazure.appservice.subscription=$AZURE_SUBSCRIPTION_ID \
-DAZURE_CLIENT_ID=$AZURE_CLIENT_ID \
-DAZURE_CLIENT_SECRET=$AZURE_CLIENT_SECRET \
-DAZURE_DEPLOY_CLIENT_ID=$AZURE_CLIENT_ID \
-DAZURE_DEPLOY_CLIENT_SECRET=$AZURE_CLIENT_SECRET \
-Dazure.appservice.resourcegroup=$AZURE_RESOURCE_GROUP \
-Dazure.appservice.plan=$AZURE_APPSERVICE_PLAN \
-Dazure.appservice.appname=$AZURE_APPSERVICE_NAME
......@@ -258,7 +262,7 @@ az webapp config set --resource-group $AZURE_RESOURCE_GROUP --name $AZURE_APPSER
```bash
mvn --settings ./.mvn/community-maven.settings.xml clean test -f integration-tests/pom.xml
mvn clean test -f $AZURE_TEST_SUBDIR/pom.xml
```
......
......@@ -12,49 +12,48 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#####################
# README: This is the default template for deploying services into a demo environment.
#####################
trigger:
batch: true
branches:
include:
- master
- master
paths:
exclude:
- README.md
- OpenDES_Azure_Security.md
- /**/*.md
- .gitignore
- images/
pool:
vmImage: 'ubuntu-latest'
demands: maven
variables:
- group: 'Azure Common Secrets'
- group: 'Azure - Common'
steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
options: '--settings ./maven/settings.xml -DVSTS_FEED_TOKEN=$(VSTS_FEED_TOKEN)'
publishJUnitResults: false
- name: serviceName
value: 'entitlements'
- task: CopyFiles@2
displayName: 'Copy artifacts for maven deploy to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder:
Contents: |
pom.xml
maven/settings.xml
target/*.jar
TargetFolder: '$(build.artifactstagingdirectory)'
resources:
repositories:
- repository: osdu-infrastructure
type: git
name: osdu-r2/osdu-infrastructure
- task: ArchiveFiles@2
displayName: 'Archive testing'
inputs:
rootFolderOrFile: integration-tests
archiveFile: '$(Build.ArtifactStagingDirectory)/testing.zip'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
condition: succeededOrFailed()
\ No newline at end of file
stages:
- template: devops/service-pipelines/build-stage.yml@osdu-infrastructure
parameters:
copyFileContents: |
pom.xml
maven/settings.xml
target/*.jar
copyFileContentsToFlatten: ''
mavenOptions: ''
serviceBase: ${{ variables.serviceName }}
testingRootFolder: 'integration-tests'
- template: devops/service-pipelines/deploy-stages.yml@osdu-infrastructure
parameters:
serviceName: ${{ variables.serviceName }}
providers:
- name: Azure
environments: ['demo']
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright © Microsoft Corporation
~
......@@ -15,25 +15,22 @@
~ limitations under the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>azure-auth</id>
<configuration>
<tenant>${AZURE_DEPLOY_TENANT}</tenant>
<client>${AZURE_DEPLOY_CLIENT_ID}</client>
<key>${AZURE_DEPLOY_CLIENT_SECRET}</key>
<environment>AZURE</environment>
</configuration>
</server>
<server>
<id>os-core</id>
<username>os-core</username>
<!-- Treat this auth token like a password. Do not share it with anyone, including Microsoft support. -->
<!-- The generated token expires on or before 11/14/2019 -->
<password>${VSTS_FEED_TOKEN}</password>
</server>
</servers>
</settings>
\ No newline at end of file
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>azure-auth</id>
<configuration>
<tenant>${AZURE_DEPLOY_TENANT}</tenant>
<client>${AZURE_DEPLOY_CLIENT_ID}</client>
<key>${AZURE_DEPLOY_CLIENT_SECRET}</key>
<environment>AZURE</environment>
</configuration>
</server>
<server>
<!-- This server is only used if a full replica of OSDU is hosted in Azure DevOps. -->
<id>os-core</id>
<username>os-core</username>
<password>${VSTS_FEED_TOKEN}</password>
</server>
</servers>
</settings>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment