Commit de6d1d04 authored by Hema Vishnu Pola [Microsoft]'s avatar Hema Vishnu Pola [Microsoft]
Browse files

Merge branch 'addingBootstrappingJob' into 'master'

Adding deployment job for bootstrapping wks mappings

See merge request !14
parents 9818da72 930996d4
Pipeline #11396 passed with stages
in 14 minutes and 24 seconds
......@@ -2,6 +2,9 @@ variables:
AZURE_SERVICE: wks
AZURE_BUILD_SUBDIR: provider/wks-azure
AZURE_TEST_SUBDIR: testing/wks-test-core
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=https;AccountName=${AZURE_BASE}sa;AccountKey=${AZURE_STORAGE_KEY};EndpointSuffix=core.windows.net
STORAGE_CONTAINER: osdu-wks-mappings
include:
- project: 'osdu/platform/ci-cd-pipelines'
......@@ -23,3 +26,5 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
ref: master
file: "cloud-providers/azure.yml"
- local: "/devops/azure/bootstrap.yaml"
## Running the WKS service locally
The WKS Service is a Maven multi-module project with each cloud implemention placed in its submodule. WKS service listen to records_change event of Storage Service. To build or run Schema Service locally, follow the below steps :
1. Clone the os-wks repository from git . Below is the URL :
[https://dev.azure.com/slb-swt/data-management/_git/os-wks](https://dev.azure.com/slb-swt/data-management/_git/os-wks)
2. Navigate to the root of the wks project, os-wks. For building the project using command line, run below command :
```bash
mvn clean install
```
This will build the core project as well as all the underlying projects. If we want to build projects for specific cloud vendor, we can use mvn --projects command. For example, if we want to build only for GCP(Google Cloud Platform), we can use below command :
```bash
mvn --projects wks-core,provider/wks-gcp clean install
```
3. Run wks service in command line. We need to select which cloud vendor specific wks-service we want to run. For example, if we want to run wks-service for GCP, run the below command :
```bash
# Running GCP :
java -jar -Dspring.profiles.active=default provider\wks-gcp\target\os-wks-gcp-0.0.1-spring-boot.jar
## License
Copyright 2017-2020, Schlumberger
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
## Running the WKS service locally
The WKS Service is a Maven multi-module project with each cloud implemention placed in its submodule. WKS service listen to records_change event of Storage Service. To build or run Schema Service locally, follow the below steps :
1. Clone the os-wks repository from git . Below is the URL :
[https://dev.azure.com/slb-swt/data-management/_git/os-wks](https://dev.azure.com/slb-swt/data-management/_git/os-wks)
2. Navigate to the root of the wks project, os-wks. For building the project using command line, run below command :
```bash
mvn clean install
```
This will build the core project as well as all the underlying projects. If we want to build projects for specific cloud vendor, we can use mvn --projects command. For example, if we want to build only for GCP(Google Cloud Platform), we can use below command :
```bash
mvn --projects wks-core,provider/wks-gcp clean install
```
3. Run wks service in command line. We need to select which cloud vendor specific wks-service we want to run. For example, if we want to run wks-service for GCP, run the below command :
```bash
# Running GCP :
java -jar -Dspring.profiles.active=default provider\wks-gcp\target\os-wks-gcp-0.0.1-spring-boot.jar
## Bootstrapping Mapping files
Currently the deployments folder contains a mappings folder with the required wks-mapping json files.
The scripts/azure folder contains a deploy_mappings.py file which uploads these mappings to Azure Blob Storage.
The devops/azure/bootstrap.yaml describes the pipeline job for triggering the above python script.
## License
Copyright 2017-2020, Schlumberger
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
\ No newline at end of file
azure_bootstrap:
stage: bootstrap
image: python:3.8
needs: ["azure_deploy"]
script:
- pip install -r $AZURE_DEPLOYMENTS_SUBDIR/requirements.txt
- python $AZURE_DEPLOYMENTS_SUBDIR/deploy_mappings.py
only:
variables:
- $AZURE == 'true'
azure_test:
needs: ["azure_bootstrap"]
only:
variables:
- $AZURE == 'true'
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