OSDU Source Code
This section provides comprehensive guidance for working with the community code and integrates automatically with an OSDU™ Personal Instance. The preconfigured src
directory structure optimizes the organization of repositories to enable efficiency. A personal instance includes generated environment variables to streamline the development process.
Tip
Environment variables can be referenced in IntelliJ with the EnvFile plugin.
Warning
Avoid using containers, always use a local machine when working with OSDU™ source code.
Overview
The directory is organized into the following structure:
-
lib
Libraries and shared components.
-
core
Core OSDU service repositories.
-
reference
Reference and Helper OSDU service repositories.
Cloning
To clone the OSDU services into this directory structure, you can use the gita
command. gita
is a tool that simplifies the management of multiple Git repositories. If you haven't already installed gita
, you can do so by following these instructions:
Installing gita
Use pip to install gita: pip install gita
Learning Opportunity
To learn more about this tool and its capabilities, check out the comprehensive gita documentation on the official GitHub repository.
Clone Repositories
Navigate to the appropriate subdirectory (e.g., lib
, core
, or reference
) and use the gita
command to clone down the required OSDU services and auto create a group.
# Clone OSDU Repositories
(cd lib && gita clone -f repos)
(cd core && gita clone -f repos)
(cd reference && gita clone -f repos)
# Create the Groups
gita add -a lib && gita group rename lib osdu-lib
gita add -a core && gita group rename core osdu-core
gita add -a reference && gita group rename reference osdu-reference
# Set the Auto Context
gita context auto
# Switch to the release branch and pull code
gita super switch release/0.27
gita pull
# Clone OSDU Repositories
Push-Location lib; gita clone -f repos; Pop-Location
Push-Location core; gita clone -f repos; Pop-Location
Push-Location reference; gita clone -f repos; Pop-Location
# Create the Groups
gita add -a lib; gita group rename lib osdu-lib
gita add -a core; gita group rename core osdu-core
gita add -a reference; gita group rename reference osdu-reference
# Set the Auto Context
gita context auto
# Switch to the release branch and pull code
gita super switch release/0.27
gita pull