Release Pipeline
The release_pipeline.py
script is the main script used within the boomi_cicd library. It will read through a release JSON
file and creating the package, deploy the processes, schedules, and listener status as defined in the file.
If the package version is not created, then the script will create the package component. Then it will deploy the version of the packaged component to the desired environment. If the process is a listener, then the listener status will be set to what is within the release JSON file. If nothing is set, then it defaults to RUNNING. Finally, if a schedule is defined, then the schedule will be set to the desired schedule.
1import boomi_cicd
2
3
4# Open release json
5releases = boomi_cicd.set_release()
6
7environment_id = boomi_cicd.query_environment(boomi_cicd.ENVIRONMENT_NAME)
8
9for release in releases["pipelines"]:
10 component_id = release["componentId"]
11 package_version = release["packageVersion"]
12 notes = release.get("notes")
13
14 package_id = boomi_cicd.query_packaged_component(component_id, package_version)
15
16 if not package_id:
17 package_id = boomi_cicd.create_packaged_component(
18 component_id, package_version, notes
19 )
20
21 # The third parameter determines if the package is currently deployed (True) or has every been deployed (False)
22 package_deployed = boomi_cicd.query_deployed_package(
23 package_id, environment_id, False
24 )
25 if not package_deployed:
26 deployment_id = boomi_cicd.create_deployed_package(
27 release, package_id, environment_id
28 )
29 # delete_deployed_package(deployment_id) # Delete deployment is useful for testing
Required Environment Variables
Environment Variable |
Description |
---|---|
BOOMI_ACCOUNT_ID |
The Boomi account ID. |
BOOMI_ATOM_NAME |
The name of the Boomi Atom. |
BOOMI_BASE_URL |
The base URL for the Boomi API. https://api.boomi.com/api/rest/v1 |
BOOMI_ENVIRONMENT_NAME |
The Boomi environment name. |
BOOMI_PASSWORD |
The Boomi password. Atomsphere API Token is recommended |
BOOMI_RELEASE_FILE |
The name of the release JSON file to use. |
BOOMI_USERNAME |
The Boomi username. Atomsphere API Token is recommended |
Command Line Arguments
-r, –release_file: The release JSON file to use. If not specified, then the BOOMI_RELEASE_FILE environment variable will be used.
Release JSON File
1{
2 "pipelines": [
3 {
4 "processName": "An Example Batch Process",
5 "packageVersion": "2.0",
6 "componentId": "83d6013f-96f5-4a75-a97b-f4934b0ec2e8",
7 "notes": "This is an example set of notes",
8 "schedule": "0 0 1 * * * ; 30 0 2-7 * * *",
9 "automatedTestId": "used within automated_testing.py"
10 },
11 {
12 "processName": "An Example Listener Process",
13 "packageVersion": "1.0",
14 "componentId": "b24f310b-6a66-4e0d-97a3-26f1e812b79a",
15 "notes": "This is an example set of notes",
16 "listenerStatus": "RUNNING"
17 },
18 {
19 "processName": "An Example Custom Library",
20 "componentId": "7bd40730-6df3-4ba9-b4b2-ed9153dbca6d",
21 "packageVersion": "1.0",
22 "notes": "Initial deployment"
23 }
24 ]
25}