Skip to content

Commit b54b944

Browse files
committed
Automation Toolkit Release v2025.1.0
1 parent 53d9280 commit b54b944

File tree

9 files changed

+43
-23
lines changed

9 files changed

+43
-23
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ARG USER_GID=$USER_UID
1616
# Whether to download Provider as part of image creation
1717
ARG DOWNLOAD_PROVIDER=YES
1818
# TF Provider version
19-
ARG TF_OCI_PROVIDER=6.15.0
20-
ARG TF_NULL_PROVIDER=3.2.1
19+
ARG TF_OCI_PROVIDER=6.30.0
20+
ARG TF_NULL_PROVIDER=3.2.3
2121

2222
RUN microdnf install -y sudo && \
2323
groupadd --gid $USER_GID $USERNAME && \

cd3_automation_toolkit/Database/export_exa_vmclusters_nonGreenField.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def print_exa_vmcluster(region, vnc_client,exa_infra, exa_vmcluster, key_name,va
8181
values_for_column[col_header].append(key_name)
8282
elif col_header == 'Client Network Details':
8383
values_for_column[col_header].append(client_network)
84-
elif col_header == 'Backup Network Detailse':
84+
elif col_header == 'Backup Network Details':
8585
values_for_column[col_header].append(backup_network)
8686
elif (col_header == "NSGs"):
8787
values_for_column[col_header].append(nsg_names)

cd3_automation_toolkit/Identity/Users/export_users_nonGreenField.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ def export_users(inputfile, outdir, service_dir, config, signer, ct,export_domai
143143
display_name = user_info.display_name
144144
email = None
145145
recovery_email = None
146-
147-
for email_info in user_info.emails:
148-
if email_info.primary:
149-
email = email_info.value
150-
elif email_info.type == "recovery":
151-
recovery_email = email_info.value
146+
if hasattr(user_info.emails, "email_info"):
147+
for email_info in user_info.emails:
148+
if email_info.primary:
149+
email = email_info.value
150+
elif email_info.type == "recovery":
151+
recovery_email = email_info.value
152152

153153

154154
tf_name = commonTools.check_tf_variable(username)

cd3_automation_toolkit/Identity/export_identity_nonGreenField.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ def process_group(grp_info, members_list,membership_id_list, domain_name, is_dyn
361361
service_endpoint=idcs_endpoint)
362362
list_groups_response = domain_client.list_groups(attributes=['members'], attribute_sets=['all'])
363363
groups = list_groups_response.data.resources
364-
while list_groups_response.has_next_page:
364+
page_done = []
365+
while list_groups_response.has_next_page and list_groups_response.next_page not in page_done:
366+
page_done.append(list_groups_response.next_page)
365367
list_groups_response = domain_client.list_groups(attributes=['members'], attribute_sets=['all'],page=list_groups_response.next_page)
366368
groups.extend(list_groups_response.data.resources)
367369

cd3_automation_toolkit/Release-Notes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
CD3 Automation Toolkit Tag v2025.1.0
33
Apr 4th, 2024
44
-------------------------------------
5-
1. Introduced new service support - MySQL Database.
5+
1. Introduced new service - MySQL Database.
66
2. Included Tunnel Inspection for OCI Network Firewall.
7-
3. Introduced filter for tags while export of resources.
8-
4. Moved compartment filter before showing xport options to make it common for all services.
7+
3. Introduced filtering of resources using tags during export workflow.
8+
4. Moved compartment filter before showing export options to make it common for all services when using toolkit with CLI.
99
5. Running Create/Modify Network through Jenkins will automatically call export of rules after successful terraform apply.
10-
This was a manua process earlier.
10+
This was a manual process earlier.
1111

1212

1313

cd3_automation_toolkit/Storage/BlockVolume/export_blockvolumes_nonGreenField.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def print_blockvolumes(region, BVOLS, bvol, compute, ct, values_for_column, ntk_
139139
source_ocids[commonTools.check_tf_variable(blockvols.display_name.strip())] = tmp_key
140140
autotune_type = ''
141141
max_vpus_per_gb = ''
142-
if len(blockvols.autotune_policies) == 0:
142+
if blockvols.autotune_policies == None:
143143
autotune_type = ''
144144
max_vpus_per_gb = ''
145145
elif len(blockvols.autotune_policies) == 1:

cd3_automation_toolkit/user-scripts/tenancyconfig.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ oci_devops_git_repo_name=
8585
# Customer Secret Key will be created for this user for S3 credentials of the bucket.
8686
# When left empty, it will be fetched from $(user_ocid) for $(auth_mechanism) as api_key.
8787
# Format: <domainName>/<userName>@<tenancyName> eg oracleidentitycloudservice/[email protected]@ocitenant
88+
# Users in Custom Domain are not supported as of now.
8889
oci_devops_git_user=
8990

9091
# When left empty, same key file from $(key_path) used for $(auth_mechanism) as api_key will be copied to

jenkins_install/scriptler/scripts/ValidateParams.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def validate_params(Workflow,MainOptions,SubOptions,SubChildOptions,AdditionalFi
1010
"DNS Management":["Add/Modify/Delete DNS Views/Zones/Records", "Add/Modify/Delete DNS Resolvers"],
1111
"Compute":["Add/Modify/Delete Dedicated VM Hosts", "Add/Modify/Delete Instances/Boot Backup Policy"],
1212
"Storage":["Add/Modify/Delete Block Volumes/Block Backup Policy", "Add/Modify/Delete File Systems", "Add/Modify/Delete Object Storage Buckets"],
13-
"Database":["Add/Modify/Delete Virtual Machine or Bare Metal DB Systems", "Add/Modify/Delete EXA Infra and EXA VM Clusters", "Add/Modify/Delete ADBs"],
13+
"Database":["Add/Modify/Delete Virtual Machine or Bare Metal DB Systems", "Add/Modify/Delete EXA Infra and EXA VM Clusters", "Add/Modify/Delete ADBs", "Add/Modify/Delete MySQL DBs"],
1414
"Load Balancers":["Add/Modify/Delete Load Balancers", "Add/Modify/Delete Network Load Balancers"],
1515
"Management Services":["Add/Modify/Delete Notifications", "Add/Modify/Delete Events", "Add/Modify/Delete Alarms", "Add/Modify/Delete ServiceConnectors"],
1616
"Developer Services":["Upload current terraform files/state to Resource Manager", "Add/Modify/Delete OKE Cluster and Nodepools"],
@@ -28,7 +28,7 @@ def validate_params(Workflow,MainOptions,SubOptions,SubChildOptions,AdditionalFi
2828
"Export DNS Management":["Export DNS Views/Zones/Records", "Export DNS Resolvers"],
2929
"Export Compute":["Export Dedicated VM Hosts", "Export Instances (excludes instances launched by OKE)"],
3030
"Export Storage":["Export Block Volumes/Block Backup Policy", "Export File Systems", "Export Object Storage Buckets"],
31-
"Export Databases":["Export Virtual Machine or Bare Metal DB Systems", "Export EXA Infra and EXA VMClusters", "Export ADBs"],
31+
"Export Databases":["Export Virtual Machine or Bare Metal DB Systems", "Export EXA Infra and EXA VMClusters", "Export ADBs", "Export MySQL DBs"],
3232
"Export Load Balancers":["Export Load Balancers", "Export Network Load Balancers"],
3333
"Export Management Services":["Export Notifications", "Export Events", "Export Alarms", "Export Service Connectors"],
3434
"Export Developer Services":["Export OKE cluster and Nodepools"],

jenkins_install/setUpOCI.groovy

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,31 @@ def exportNetworkRules(stage_name) {
55
return {
66
stage("${stage_name}") {
77
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
8-
sh """
8+
labelledShell( label: 'Executing setUpOCI python script', script: """
99
cd /cd3user/oci_tools/cd3_automation_toolkit
1010
python setUpOCI.py --devops True --main_options "Network" --sub_options "Security Rules,Route Rules,DRG Route Rules" --sub_child_options "Export Security Rules (From OCI into SecRulesinOCI sheet),Add/Modify/Delete Security Rules (Reads SecRulesinOCI sheet),Export Route Rules (From OCI into RouteRulesinOCI sheet),Add/Modify/Delete Route Rules (Reads RouteRulesinOCI sheet),Export DRG Route Rules (From OCI into DRGRouteRulesinOCI sheet),Add/Modify/Delete DRG Route Rules (Reads DRGRouteRulesinOCI sheet)" --add_filter "comp_filter=,[],@," ${env.prop_file}
11-
"""
12-
file_path = sh(script: "grep '^cd3file' ${env.prop_file}| cut -d'=' -f2", returnStdout: true).trim()
13-
file_name = sh(script:"echo '${file_path}'| rev|cut -d '/' -f1 | rev", returnStdout: true).trim()
11+
""")
12+
script {
13+
git_status = labelledShell( label: 'Check git status', script: 'cd ${prefix_dir}/terraform_files; git status --porcelain | wc -l', returnStdout: true).trim()
14+
// Check if anything to commit
15+
if ("${git_status}" > 0) {
16+
labelledShell( label: 'Performing git commit to develop', script: '''
17+
set +x
18+
cd ${prefix_dir}/terraform_files
19+
echo "-----start timestamp-----"
20+
time_stamp="$(date +%m-%d-%Y-%H-%M-%S)"
21+
commit_msg="commit for setUpOCI build ${BUILD_NUMBER}"
22+
git add -A .
23+
git commit -m "${commit_msg}"
24+
git push origin develop
25+
''')
26+
}else {
27+
echo 'Nothing to commit. Skipping further stages.'
28+
}
29+
}
30+
31+
file_path = sh(script: "set +x; grep '^cd3file' ${env.prop_file}| cut -d'=' -f2", returnStdout: true).trim()
32+
file_name = sh(script:"set +x; echo '${file_path}'| rev|cut -d '/' -f1 | rev", returnStdout: true).trim()
1433
sh """
1534
set +x
1635
cp '${file_path}' '${WORKSPACE}/${file_name}'
@@ -40,9 +59,7 @@ def generateStage(job) {
4059
//println(job_exec_details.getFullProjectName())
4160
//println((job_exec_details.getFullProjectName()).split("/")[3])
4261
if (!["ABORTED","FAILURE"].contains(job_exec_details.getResult()) && ["apply","network"].contains((job_exec_details.getFullProjectName()).split("/")[3])) {
43-
println("first condition passed")
4462
if ( SubOptions.contains('Create Network') || SubOptions.contains('Modify Network') ) {
45-
println("Calling export rules")
4663
def stage_name = "Export Network Rules"
4764
parallel([stage_name : exportNetworkRules(stage_name)])
4865
}

0 commit comments

Comments
 (0)