GitLab & Pipelines
DWP Project uses GitLab for git and CI/CD
Projects
The project consists of two project (in our case)
- DWP Core https://gitlab.com/ds365ai/DSWC
- DWP AkerBP https://gitlab.com/ds365ai/SnowLeopard
Frontend main repos
- dwp-core - Angular projects for dwp-app. Most of the core logic is in here.
- dwp-app - main webapp
- dwp-akerbp-lib - AkerBP Angular projects - custom libraries for snowleopard
- unit-conversion - lib for unit conversion
- dwp-landing-page - landing page components
Infra / backend repos
- config - DSIS configuration files
- dwp-db-utility - DB migrations and VDBs
- dwp-beta-live-repo - live repo (helm files)
- We don't have access to the below repos, so to find environment variables and their values its best to use
kubectl
- https://gitlab.com/Halliburton-Landmark/dsif/live/azure/hal-abpprd06 - preprod
- https://gitlab.com/Halliburton-Landmark/dsif/live/azure/hal-abpprd04 - prod
- https://gitlab.com/Halliburton-Landmark/dsif/live/aws/akerbp-oec-live - OEC
- We don't have access to the below repos, so to find environment variables and their values its best to use
Microservices
Everything that starts with microservice-
or dwp-middleware
Branching strategy and pipelines
Usually Dev_Integration_Branch
is the main branch. Developers usually just create feature branches
Naming convention (IMPORTANT)
AkerBP
- Deploy to
akerbp242
:abp242-test-deliver
- Deploy to
akerbp300
:abp300-test-feature-deliver
DSWC
For R&D we need to be aware of which team we are working for as thing get routed to different namespaces
B4C/Build4Core: abp-<name>-deliver
For other teams, please ask Thien Phung on teams
The -deliver
suffix will create a new pipeline for that branch and deploy to K8S a container that contains the first 14 characters of branch name. It will also append a service name e.g. abp-descriptio-dwp-middleware
Note: Branches without -deliver
will not have the deploy step of the pipeline
You can find k8s namespace and pod info by checking the deployment job logs in GitLab.
Refer to k8s cluster management for logging into the correct cluster.
kubectl get pod -n <yournamespace> | grep <yourpodname>
Multi branch deployments in development
IF USING MICROSERVICES in addition Use this guide
Use case: you want to deploy a branch of dwp-core
and dwp-landing-page
. Make sure you use the same branch name in all repos.
DSWC
Here the branch name was abp-1166-hss-deliver
. Make sure to check the pipeline job logs to find the correct version identifier to use here. Check the Build node
job and search for your branch name
The package.json of dwp-app
and dwp-landing-page
would be changed to:
"@dswc/dwp-offset-well": ">=17.0.0-abp-1166-hss-deliver.1 <17.0.0-abp-1166-hss-deliver.9999"
for all packages related to dwp-core.
Snowleopard
Slightly different approach, here dwp-app
will be automatically updated with the exact version of the latest deployment of dwp-core
and e.g dwp-akerbp-lib
if the branch names are equal.
Example approach:
- Make a branch of
dwp-app
calledsomething-deliver
- Make a branch of
dwp-core
calledsomething-deliver
dwp-core
pipeline will runversionUpdate.js
from the root of the repo to actually updatedwp-app
package.json
Version names can be found in the pipeline logs (branch names might be truncated or stripped of special chars)
Testing you feature branch (-deliver)
Sometimes you need to test your work in a feature branch or share it with others for QA / Review.
Find the name as mentioned before. [branch-name] === 14 first characters of branch name in GitLab.
Feature branch URL
Use this url generator to generate urls for accessing deployed version of your feature branches
Then use it like this: https://[branch-name]-dwp-webapp.oec-prod-dsif2.openearth.io/
Example for DSWC:
https://b4c-1338992-up-webapp-dwp-webapp.oec-prod-dsif2.openearth.io/
Example for AkerBP:
https://b4c-1338992-up-webapp-dwp-webapp.oec-prod-essav4-admin.openearth.io/
Microservices
https://oec-prod-dsif2.openearth.io/services/[branch-name]-[service-name]
Example: https://oec-prod-dsif2.openearth.io/services/b4c-1166-hss-d-microservice-holesection-summary
b4c (build for core) is written under core projects
Commit message
For commit convention it will start with either fix:
chore:
feat:
and new line with ticket url. For commandline use Shift+Enter
to create a newline that satisfies the pipeline gods
Example:
git commit -m "feat: spike to remove unused functionalities of AkerBP customization
https://dev.azure.com/HAL-LMKSRVST/DWP%20AKERBP%20Funded%20Development/_sprints/"