Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
05affd4
Added support for multiple Applications Mapping files
M-DLB Mar 3, 2025
448492e
Support for Db2 metadatastore (#25)
M-DLB Mar 13, 2025
473eb76
Rebased from main
M-DLB Mar 13, 2025
47eb266
Added support for multiple Applications Mapping files
M-DLB Mar 3, 2025
6da9b2f
Fixed applications mapping file path
M-DLB Mar 13, 2025
72dcb55
Reworked the extraction process
M-DLB Mar 14, 2025
9c3bfa1
Merged from main
M-DLB Mar 17, 2025
ab4f3b2
Apply suggestions from code review
M-DLB Apr 8, 2025
c02ce45
Simplified processing
M-DLB Apr 8, 2025
f7554c1
Added suggestion from peer review
M-DLB Apr 9, 2025
95025aa
Changed schema
M-DLB Apr 9, 2025
b6f88dc
Changed Setup to include Applications Mapping folder
M-DLB Apr 9, 2025
6befcff
Changed sequence in Setup
M-DLB Apr 9, 2025
46ad9e8
Moved advanced doc
M-DLB Apr 9, 2025
b3a15a9
Reworked documentation and fixed issues in the Recreate AD process
M-DLB Apr 9, 2025
59bd058
Removed extra prints
M-DLB Apr 9, 2025
f1210d3
Apply suggestions from code review
M-DLB Apr 10, 2025
fb029fa
Refined messages in the extraction process
M-DLB Apr 10, 2025
02a25ad
Enhanced documentation
M-DLB Apr 10, 2025
7e84ecc
apply new schema
dennis-behm Apr 16, 2025
94ecfbd
fix syntax error
dennis-behm Apr 16, 2025
119548a
configure upload to common package strategy
dennis-behm Apr 16, 2025
93572cf
pretty print setup scripts + minor re-org
dennis-behm Apr 16, 2025
9641998
Append ARTIFACT repository suffix
dennis-behm Apr 16, 2025
ea728eb
Update yaml schema for application descriptor
dennis-behm Apr 16, 2025
c2b0f3b
Included reviewer feedback
M-DLB Apr 22, 2025
f5fb888
Changed scenarios order in doc
M-DLB Apr 22, 2025
f2f351d
Fixed broken links
M-DLB Apr 22, 2025
28ddeaa
Fixed broken links
M-DLB Apr 22, 2025
858ed85
Fixed documentation
M-DLB Apr 22, 2025
6e48030
Merge remote-tracking branch 'mathieu/feature/multipleApplicationsMap…
dennis-behm Apr 22, 2025
03db6b0
Resolve Merge conflicts
dennis-behm Apr 22, 2025
56ad1dd
Revert changes in Setup.sh
dennis-behm Apr 23, 2025
b787e84
Minor changes in Setup.sh
dennis-behm Apr 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ DBB_MODELER_HOME=$(cd "$(dirname "$0")" && pwd)
export MigrationModelerRelease=`cat $DBB_MODELER_HOME/release.properties | awk -F '=' '{printf $2}'`
Prolog

if [ "$DBB_HOME" = "" ]
then
if [ "$DBB_HOME" = "" ]; then
echo "[ERROR] Environment variable DBB_HOME is not set. Exiting."
exit 1
fi
Expand All @@ -52,7 +51,7 @@ echo "[SETUP] Configuring DBB Git Migration Modeler environment variables"
DBB_MODELER_WORK="${DBB_MODELER_HOME}-work"
read -p "Specify the DBB Git Migration Modeler work directory [default: $DBB_MODELER_WORK]: " variable
if [ "$variable" ]; then
DBB_MODELER_WORK="${variable}"
DBB_MODELER_WORK="${variable}"
fi

# Default environment variables
Expand Down Expand Up @@ -114,20 +113,23 @@ ARTIFACT_REPOSITORY_USER=user
# Password to connect to the Artifact Repository Server
# e.q.: ARTIFACT_REPOSITORY_PASSWORD=xxxxx
ARTIFACT_REPOSITORY_PASSWORD=password
# Artifact repository naming suffix
# e.q.:
ARTIFACT_REPOSITORY_SUFFIX=zos-local

# User ID of the pipeline user
PIPELINE_USER=ADO
# Group that the User ID of the pipeline user belongs to
PIPELINE_USER_GROUP=JENKINSG
# Pipeline technology used
# Either '1' for 'AzureDevOps', '2' for 'GitlabCI', '3' for 'Jenkins' or '4' for 'GitHubActions'
# The parameter will then be translated later in the process to its final value
# The parameter will then be translated later in the process to its final value
# as defined in the Templates folder of the DBB Community repo (without the 'Pipeline' suffix)
PIPELINE_CI=1

# Arrays for configuration parameters, that will the Setup script will prompt the user for
path_config_array=(DBB_MODELER_APPCONFIG_DIR DBB_MODELER_APPLICATION_DIR DBB_MODELER_LOGS DBB_MODELER_DEFAULT_GIT_CONFIG)
input_array=(DBB_MODELER_APPMAPPINGS_DIR REPOSITORY_PATH_MAPPING_FILE APPLICATION_MEMBER_TYPE_MAPPING TYPE_CONFIGURATIONS_FILE APPLICATION_ARTIFACTS_HLQ SCAN_DATASET_MEMBERS SCAN_DATASET_MEMBERS_ENCODING DBB_ZAPPBUILD DBB_COMMUNITY_REPO APPLICATION_DEFAULT_BRANCH INTERACTIVE_RUN PUBLISH_ARTIFACTS ARTIFACT_REPOSITORY_SERVER_URL ARTIFACT_REPOSITORY_USER ARTIFACT_REPOSITORY_PASSWORD PIPELINE_USER PIPELINE_USER_GROUP)
input_array=(DBB_MODELER_APPMAPPINGS_DIR REPOSITORY_PATH_MAPPING_FILE APPLICATION_MEMBER_TYPE_MAPPING TYPE_CONFIGURATIONS_FILE APPLICATION_ARTIFACTS_HLQ SCAN_DATASET_MEMBERS SCAN_DATASET_MEMBERS_ENCODING DBB_ZAPPBUILD DBB_COMMUNITY_REPO APPLICATION_DEFAULT_BRANCH INTERACTIVE_RUN PUBLISH_ARTIFACTS ARTIFACT_REPOSITORY_SERVER_URL ARTIFACT_REPOSITORY_USER ARTIFACT_REPOSITORY_PASSWORD ARTIFACT_REPOSITORY_SUFFIX PIPELINE_USER PIPELINE_USER_GROUP)

# Create work dir
echo
Expand All @@ -142,16 +144,6 @@ if [[ -z "$variable" || $variable =~ ^[Yy]$ ]]; then
else
mkdir -p $DBB_MODELER_WORK
rc=$?

if [ $rc -eq 0 ]; then
if [ ! -d "${DBB_MODELER_DEFAULT_GIT_CONFIG}" ]; then
mkdir -p $DBB_MODELER_DEFAULT_GIT_CONFIG
fi

cp $DBB_MODELER_HOME/samples/git-config/* $DBB_MODELER_DEFAULT_GIT_CONFIG/
cp $DBB_MODELER_HOME/samples/git-config/.* $DBB_MODELER_DEFAULT_GIT_CONFIG/
rc=$?
fi
fi
fi

Expand All @@ -163,7 +155,7 @@ if [ $rc -eq 0 ]; then
if [ "$variable" ]; then
declare DBB_MODELER_METADATASTORE_TYPE="${variable}"
fi

if [ "$DBB_MODELER_METADATASTORE_TYPE" = "file" ]; then
read -p "Specify the location of the DBB File Metadatastore [default: ${DBB_MODELER_FILE_METADATA_STORE_DIR}]: " variable
if [ "$variable" ]; then
Expand Down Expand Up @@ -192,8 +184,8 @@ if [ $rc -eq 0 ]; then
echo "[ERROR] Either the Db2 JDBC User Password or the Db2 JDBC Password File must be specified. Exiting."
rm -rf $DBB_MODELER_WORK
exit 1
fi
fi
fi
fi
fi

if [ $rc -eq 0 ]; then
Expand Down Expand Up @@ -226,10 +218,10 @@ if [ $rc -eq 0 ]; then
"4")
PIPELINE_CI="GitHubActions"
;;
esac
esac

echo
echo "[SETUP] Copying DBB Git Migration Modeler configuration files to '$DBB_MODELER_WORK'"
echo "[SETUP] Copying DBB Git Migration Modeler sample configuration files to '$DBB_MODELER_WORK'"
if [ ! -d "${DBB_MODELER_APPMAPPINGS_DIR}" ]; then
mkdir -p $DBB_MODELER_APPMAPPINGS_DIR
rc=$?
Expand All @@ -247,7 +239,16 @@ if [ $rc -eq 0 ]; then
rc=$?
fi
if [ $rc -eq 0 ]; then
cp $DBB_MODELER_HOME/samples/typesConfigurations.yaml $TYPE_CONFIGURATIONS_FILE
cp $DBB_MODELER_HOME/samples/typesConfigurations.yaml $TYPE_CONFIGURATIONS_FILE
rc=$?
fi
if [ $rc -eq 0 ]; then
if [ ! -d "${DBB_MODELER_DEFAULT_GIT_CONFIG}" ]; then
mkdir -p $DBB_MODELER_DEFAULT_GIT_CONFIG
fi

cp $DBB_MODELER_HOME/samples/git-config/* $DBB_MODELER_DEFAULT_GIT_CONFIG/
cp $DBB_MODELER_HOME/samples/git-config/.* $DBB_MODELER_DEFAULT_GIT_CONFIG/
rc=$?
fi
fi
Expand All @@ -267,7 +268,7 @@ fi
if [ $rc -eq 0 ]; then
DBB_GIT_MIGRATION_MODELER_CONFIG_FILE="${CONFIG_DIR}/DBB_GIT_MIGRATION_MODELER.config"
touch $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE
chtag -tc IBM-1047 $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE
chtag -tc IBM-1047 $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE

echo "# DBB Git Migration Modeler configuration settings" > $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE
echo "# Generated at $(date)" >> $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE
Expand Down Expand Up @@ -303,15 +304,15 @@ if [ $rc -eq 0 ]; then
echo "This DBB Git Migration Modeler configuration file will be imported by the DBB Git Migration Modeler process."
echo
if [ "$DBB_MODELER_METADATASTORE_TYPE" = "db2" ]; then
## Checking DBB Toolkit version
## Checking DBB Toolkit version
CURRENT_DBB_TOOLKIT_VERSION=`$DBB_MODELER_HOME/src/scripts/utils/0-environment.sh -c $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE -v 3.0.1`
rc=$?
rc=$?
if [ $rc -ne 0 ]; then
rc=8
echo "[ERROR] The DBB Toolkit's version is $CURRENT_DBB_TOOLKIT_VERSION. To use the Db2-based MetadataStore, the minimal recommended version for the DBB Toolkit is 3.0.1."
fi
else
## Checking DBB Toolkit version
## Checking DBB Toolkit version
CURRENT_DBB_TOOLKIT_VERSION=`$DBB_MODELER_HOME/src/scripts/utils/0-environment.sh -c $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE -v 2.0.2`
rc=$?
if [ $rc -ne 0 ]; then
Expand All @@ -325,7 +326,7 @@ if [ $rc -eq 0 ]; then
echo "********************************************* SUGGESTED ACTION *********************************************"
echo "Check the successful configuration and access to the Db2-based MetadataStore with the following command:"
echo "'$DBB_MODELER_HOME/src/scripts/CheckDb2MetadataStore.sh -c $DBB_GIT_MIGRATION_MODELER_CONFIG_FILE'"
fi
fi
echo
echo "********************************************* SUGGESTED ACTION *********************************************"
echo "Tailor the following input files prior to using the DBB Git Migration Modeler:"
Expand Down
45 changes: 35 additions & 10 deletions schema/application-descriptor-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,26 @@
"type": "string",
"description": "Branch name for which the baseline is set"
},
"baseline": {
"type": {
"type": "string",
"title": "The type of build of the baseline archive.",
"description": "Type of build of the baseline archive.",
"default": "release",
"enum": [
"release",
"build"
]
},
"reference": {
"type": "string",
"description": "Baseline reference for the given branch"
"title": "The reference of the baseline archive.",
"description": "In case of a release build, the release identifier reference like rel-2.1.0. Or a preliminary build reference by indicating the branch name from where the archive is derived."
}
,
"buildid": {
"type": "string",
"title": "The build identifier of the baseline archive.",
"description": "The unique identifier of the archive."
}
}
}
Expand All @@ -145,23 +162,31 @@
},
"type": {
"type": "string",
"title": "The location of the dependency.",
"description": "Location from where the dependency is fetched.",
"default": "artifactrepository",
"title": "The type of build of the dependent archive.",
"description": "Type of build of the dependent archive.",
"default": "release",
"enum": [
"artifactrepository"
"release",
"build"
]
},
"version": {
"reference": {
"type": "string",
"title": "The reference of the dependency.",
"description": "In case of a release build, the release identifier reference like rel-2.1.0. Or a preliminary build reference by indicating the branch name from where the archive is derived."
}
,
"buildid": {
"type": "string",
"title": "The version of the dependency.",
"description": "Can either be a release version including the unique identifier of the build or a preliminary package."
"title": "The build identifier of the dependent application archive.",
"description": "The unique identifier of the archive."
}
},
"required": [
"name",
"type",
"version"
"reference",
"buildid"
]
}
},
Expand Down
14 changes: 12 additions & 2 deletions src/groovy/assessUsage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ def parseArgs(String[] args) {
logger.logMessage("*! [ERROR] The type of MetadataStore (file or db2) must be specified in the DBB Git Migration Modeler Configuration file. Exiting.")
System.exit(1)
}

if (configuration.APPLICATION_DEFAULT_BRANCH) {
props.APPLICATION_DEFAULT_BRANCH = configuration.APPLICATION_DEFAULT_BRANCH
} else {
logger.logMessage("*! [ERROR] The default branch name setting APPLICATION_DEFAULT_BRANCH must be specified in the DBB Git Migration Modeler Configuration file. Exiting.")
System.exit(1)
}

if (props.DBB_MODELER_METADATASTORE_TYPE.equals("file")) {
if (configuration.DBB_MODELER_FILE_METADATA_STORE_DIR) {
Expand Down Expand Up @@ -457,8 +464,11 @@ def updateConsumerApplicationDescriptor(consumer, dependencyType, providerApplic
}
}
// Consumer's Application Descriptor file has been found and can be updated
if (consumerApplicationDescriptor) {
applicationDescriptorUtils.addApplicationDependency(consumerApplicationDescriptor, providerApplicationDescriptor.application, "latest", dependencyType)
if (consumerApplicationDescriptor) { // fetch the internal baseline that is added
providerInternalBaseline=providerApplicationDescriptor.baselines.find() { baselineDefinition ->
baselineDefinition.branch.equals(props.APPLICATION_DEFAULT_BRANCH)
}
applicationDescriptorUtils.addApplicationDependency(consumerApplicationDescriptor, providerApplicationDescriptor.application, providerInternalBaseline.reference , providerInternalBaseline.buildid )
applicationDescriptorUtils.writeApplicationDescriptor(consumerApplicationDescriptorFile, consumerApplicationDescriptor)
}
// update provider's Application Descriptor
Expand Down
8 changes: 4 additions & 4 deletions src/groovy/extractApplications.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ def generateApplicationFiles(String application) {
applicationDescriptor.description = foundApplication.description
applicationDescriptor.owner = foundApplication.owner
// Adding baseline to ApplicationDescriptor
applicationDescriptorUtils.addBaseline(applicationDescriptor, "main" as String, foundApplication.baseline)
applicationDescriptorUtils.addBaseline(applicationDescriptor, "release/${foundApplication.baseline}" as String, foundApplication.baseline)
applicationDescriptorUtils.addBaseline(applicationDescriptor, "main", "release", foundApplication.baseline)
applicationDescriptorUtils.addBaseline(applicationDescriptor, "release/${foundApplication.baseline}", "release", foundApplication.baseline)
} else {
applicationDescriptor.application = "UNASSIGNED"
applicationDescriptor.description = "Unassigned components"
applicationDescriptor.owner = "None"
applicationDescriptorUtils.addBaseline(applicationDescriptor, "main" as String, "rel-1.0.0" as String)
applicationDescriptorUtils.addBaseline(applicationDescriptor, "release/rel-1.0.0" as String, "rel-1.0.0" as String)
applicationDescriptorUtils.addBaseline(applicationDescriptor, "main", "release", "rel-1.0.0")
applicationDescriptorUtils.addBaseline(applicationDescriptor, "release/rel-1.0.0", "release", "rel-1.0.0")
}

// Main loop, iterating through the dataset members assigned to the current application
Expand Down
Loading