
#Install the WeData client (no installation package required, simply run the program).#Singapore area#macOS system installationcurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh#windows system installationcurl.exe -fsSL https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/windows/install.bat -o install.bat && install.bat

wedata auth login

wedata bundle init
targets:dev:mode: developmentworkspace:host: https://wedata-studio-fusion.cloud.tencent.com/studio/clone/packages/edit/11336a82-dd7c-4ba6-b3a6-74bda71cc237?ProjectId=2998786495253803008default: trueprod:mode: productionworkspace:host: https://wedata-studio-fusion.cloud.tencent.com/studio/datadev/workflow?ProjectId=2995753587734867968root_path: /Workspace/Users/test5-auto-test1/.bundle/${bundle.name}/${bundle.target}
wedata bundle generate workflow --existing-workflow-id ${workflow_id} -t dev -p ${profile_name}
wedata bundle generate triggerworkflow --existing-triggerworkflow-id ${workflow_id} -t dev -p ${profile_name}

wedata bundle deployment bind task ${resource key} ${task_id} -t dev -p ${profile_name}wedata bundle deployment bind workflow ${resource key} ${workflow_id} -t dev -p ${profile_name}
wedata bundle deployment bind triggertask ${resource key} ${task_id} -t dev -p ${profile_name}wedata bundle deployment bind triggerworkflow ${resource key} ${workflow_id} -t dev -p ${profile_name}
wedata bundle validate -t devwedata bundle run task ${resource key} -t dev -p ${profile_name}wedata bundle deploy -t dev
wedata bundle validate -t devwedata bundle run triggertask ${resource key} -t dev -p ${profile_name}wedata bundle deploy -t dev
#Install the WeData client (no installation package required, simply run the program).#Singapore area#macOS system installationcurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh#windows system installationcurl.exe -fsSL https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/windows/install.bat -o install.bat && install.bat

wedata auth login

wedata bundle init
targets:dev:mode: developmentworkspace:host: https://wedata-studio-fusion.cloud.tencent.com/studio/clone/packages/edit/11336a82-dd7c-4ba6-b3a6-74bda71cc237?ProjectId=2998786495253803008default: trueprod:mode: productionworkspace:host: https://wedata-studio-fusion.cloud.tencent.com/studio/datadev/workflow?ProjectId=2995753587734867968root_path: /Workspace/Users/test5-auto-test1/.bundle/${bundle.name}/${bundle.target}

wedata bundle validate -t devwedata bundle deploy -t dev
wedata bundle validate -t prodwedata bundle deploy -t prod
stages:- build# The build logic of the dev branchbuild_dev:stage: buildtags:- docker #CICD machine label, modify as neededscript:- |set -exapk add --no-cache curl sudocurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh -s -- --region 'https://api-ap-singapore.wedata.tencentcloud.com'#Download the client script; it needs to be modified to suit different environments.# Create configuration fileconfig_file="$HOME/.wedatacfg"if [ ! -f "$config_file" ]; thenecho "The configuration file does not exist; create a new configuration file..."echo "host =https://ap-singapore.wedata.cloud.tencent.com/studio/datadev/workflow?ProjectId=2430455587205529600" > "$config_file"#It needs to be modified to any wedata URL in the current environment.echo "secret_id =******" >> "$config_file"#current user's secret_idecho "secret_key =******" >> "$config_file"#current user's secret_keyecho "region =ap-singapore" >> "$config_file"#Modify to the corresponding areaecho "is_intl =false" >> "$config_file"echo "The content is as follows:"cat "$config_file"elseecho "Current configuration details:"cat "$config_file"ficd wedata-cicd-test/cicd_bjjr/v_vyuyudu_bjjr/# Path to the corresponding bundleecho "This is the build logic for the dev branch."wedata bundle validate -t devecho "Start pushing to the dev environment:"wedata bundle deploy -t devonly:- dev #Change to the git branch name# The construction logic of the prod branchbuild_prod:stage: buildtags:- dockerscript:- |set -exapk add --no-cache curl sudocurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh -s -- --region 'https://api-ap-singapore.wedata.tencentcloud.com'#Download the client script; you'll need to modify it to suit different environments.# Create configuration fileconfig_file="$HOME/.wedatacfg"if [ ! -f "$config_file" ]; thenecho "The configuration file does not exist; create a new configuration file..."echo "host =https://ap-singapore.wedata.cloud.tencent.com/studio/datadev/workflow?ProjectId=2430455587205529600" > "$config_file"#It needs to be modified to any wedata URL in the current environment.echo "secret_id =******" >> "$config_file"echo "secret_key =******" >> "$config_file"echo "region =ap-singapore" >> "$config_file"echo "is_intl =false" >> "$config_file"echo "The content is as follows:"cat "$config_file"elseecho "Current configuration details:"cat "$config_file"ficd wedata-cicd-test/cicd_bjjr/v_vyuyudu_bjjr/echo "This is the build logic for the prod branch."wedata bundle validate -t prodecho "Start pushing to the prod environment:"wedata bundle deploy -t prodonly:- merge_requests # Triggered for merge scenarios- prod # Triggered on the prod branch




# This is a Wedata asset bundle definitionbundle:name: wedataBundleDemouuid: e1e95042-9e18-4806-a2e6-8de5e535881cwedata_cli_version: '0.18.*'# allow any Wedata CLI version between 0.218.0 and 1.0.0, inclusive# wedata_cli_version: '>= 0.218.0, <= 1.0.0'# Paths to match based on root directoryinclude:- resources/*/*.yml# Deploy synchronizes default+include folders that are not filtered by exclude rules, using Glob patternsync:include:- "resources/**"- "src/**"- "tests/**"exclude:- "tests/README.md"targets:dev:# The default target uses 'mode: development' to create a development copy.# - Deployed resources get prefixed with '[dev my_user_name]'# - Any job schedules and triggers are paused by default.mode: development# Specify the environment configuration for the current bundledefault: truevariables: #You can define different environment variables heretest_worker_group_id: "20241120210318772642"cluster_id: "123"workspace:# projectAddrhost: https://ap-beijing.wedata.cloud.tencent.com/studio/datadev/workflow?ProjectId=1460726726769418240# root_path: ~/.bundle/${bundle.name}/${bundle.target}# ~/ also represents the user's personal path, equivalent to root_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}# Note: root_path must start with '~/' or contain the current username to ensure uniqueness when using 'mode: development'prod:mode: productionvariables: #You can define different environment variables heretest_worker_group_id: "2024112021031872222"cluster_id: "111"workspace:# projectAddrhost: https://ap-beijing.wedata.cloud.tencent.com/studio/datadev/workflow?ProjectId=1460726726769418240# We explicitly deploy to /Workspace/Users/asherxu@tencent.com to make sure we only have a single copy.root_path: /Workspace/Users/demo@tencent.com/.bundle/${bundle.name}/${bundle.target}# Global custom variables, usage definition: ${var.<variable_name>}variables:test_worker_group_id:description: defaultGroupIDdefault: "20241120210318772644"type: stringcluster_id:description: defaultClusterIDdefault: "234"type: string
variables:scheduling_resource_group:description: "scheduling_resource_group_name"default: "resource_group_A"type: string
targets:dev:mode: developmentvariables:scheduling_resource_group: "resource_group_A"prod:mode: productionvariables:scheduling_resource_group: "resource_group_B"
resources:tasks:taskResourceKey:this_is_task_keyname: taskNameresourceGroupName: ${var.scheduling_resource_group}
resources:workflows:bundle_example_workflow:name: "bundle_example_workflow"remoteDirPath: Default/temp/ownerName: ${var.ownerName}workflowDesc: ""workflowType: "cycle"workflowParams:paramDs: []workflowSchedulerConfiguration:startTime: "2025-10-22 11:37:57"endTime: "2099-12-31 23:59:59"executionStartTime: "00:00"executionEndTime: "23:59"crontabExpression: "0 0 0 * * ? *"scheduleTimeZone: "UTC+8"selfDepend: "serial"dependencyWorkflow: "no"cycleStep: 0cycleType: "DAY_CYCLE"delayTime: 0
resources:tasks:bundle_example_task_python_task:name: "bundle_example_task_python"filePath: "../../src/task/bundle_example_task_python.py"remoteDirPath: Default/temp/taskBaseAttribute:taskTypeName: "PYTHON"workflowName: "demo"taskDescription: "This is a python task"ownerName: lolayqzhangtaskConfiguration:resourceGroupName: test_workerbrokerIp: "any"taskExtConfigurationList:- paramKey: "python_type"paramValue: "python3"- paramKey: "python_sub_version"paramValue: "python3"- paramKey: "extraInfo"paramValue: "{\\"fromMapping\\":false}"taskSchedulingParameterList: []taskSchedulerConfiguration:crontabExpression: "0 0 0 * * ? *"cycleType: "DAY_CYCLE"scheduleTimeZone: "UTC+8"startTime: "2025-10-24 00:00:00"endTime: "2099-12-31 23:59:59"executionStartTime: "00:00"executionEndTime: "23:59"scheduleRunType: 0selfDepend: "serial"upstreamDependencyConfigList: []downstreamDependencyConfigList: []runPriority: "low"retryWait: 5maxRetryAttempts: 4executionTTL: -1waitExecutionTotalTTL: "-1"allowRedoType: "ALL"
childPath:- "../../src/forEachChild/test_foreach_end_foreach.yml"- "../../src/forEachChild/test_foreach_start_foreach.yml"- "../../src/forEachChild/test_dlcsql.yml"
triggerTaskSchedulerConfiguration:upstreamDependencyConfigList:- taskName: "start_foreach"
resources:triggerWorkflows:bundle_example_triggerWorkflow_triggerWorkflow:name: "bundle_example_triggerWorkflow"remoteDirPath: Default/tempownerName: ${var.ownerName}workflowDesc: "this is a triggerWorkflow"workflowParams:paramDs: []triggerWorkflowSchedulerConfigurations:- schedulerStatus: "ACTIVE"triggerMode: "TIME_TRIGGER"scheduleTimeZone: "UTC+8"startTime: "2025-12-17 20:29:55"endTime: "2099-12-31 23:59:59"configMode: "COMMON"cycleStep: 0cycleType: "DAY_CYCLE"crontabExpression: "0 0 1 * * ? *"delayTime: 0
resources:triggerTasks:bundle_example_triggerTask_python_triggerTask:name: "bundle_example_triggerTask_python"filePath: "../../src/triggerTask/bundle_example_triggerTask_python.py"remoteDirPath: Default/temptriggerTaskBaseAttribute:taskTypeName: "PYTHON"workflowName: "bundle_example_triggerWorkflow"taskDescription: "this is a python triggerTask"ownerName: ${var.ownerName}triggerTaskConfiguration:resourceGroupName: ${var.resourceGroupName}brokerIp: "any"taskExtConfigurationList:- paramKey: "python_sub_version"paramValue: "python3"- paramKey: "python_type"paramValue: "python3"- paramKey: "waitExecutionTotalTTL"paramValue: "-1"taskSchedulingParameterList: []triggerTaskSchedulerConfiguration:upstreamDependencyConfigList: []allowRedoType: "ALL"
resources:resourceFiles:resourceFileResourceKey:name: resourceFileName# Wedata remote directoryremoteDirPath: /fd1/test/# Parameter namefilePath: ../../src/resourceFile/datastudio-service-5.2.0.1.jar# COS bucket namebucketName: wedata-cos# COS bucket regioncosRegion: ap-shanghai
resources:projectParams:paramResourceKey:# Parameter name keyname: paramName# Parameter descriptionparamDescription: paramDescription# Debug run valueparamDefineTest: dryRunVal# Cycle scheduling valueparamDefine: scheduleRunVal
resources:alarms:alarmResourceKey:# Alarm namename: alarmName# Alarm rule descriptiondescription: description# List of monitored object business names (task names)monitorObjectNames:- taskName1- taskName2# Monitor type: task, workflow, projectmonitorObjectType: task# Alarm type: 1.failure alarm, 2.timeout alarm, 3.success alarm, 4.baseline breach, 5.baseline warning, 6.baseline task failure, 7.alarm monitoring, alarm type code list (default 1.failure alarm)alarmTypes:- failAlarmalarmGroups:- alarmRecipientType: Task Owner # Alarm recipient type: 1.specified personnel, 2.task owner, 3.duty roster (default 1.specified personnel)# Alarm level, 1.normal, 2.important, 3.urgent (default 1.normal)alarmLevel: normal# Alarm escalation user namesalarmEscalationRecipientNames:- asherxu@tencent.com# Alarm escalation intervalalarmEscalationInterval: 86400# Alarm user namesalarmRecipientNames:- asherxu@tencent.com# Alarm methods: 1.email, 2.SMS, 3.WeChat, 4.voice, 5.WeCom, 6.Http, 7.WeCom group, 8.Feishu group (default 1.email)alarmWays:webHooks:alarmWay: "Teams"webHooks: "http://open/group"# Alarm notification frequencynotificationFatigue:# Notification count (3 times)notifyCount: 3# Notification interval, in minutesnotifyInterval: 5# Do not disturb timequietIntervals:- daysOfWeek: [ 1, 2 ] # Days of weekstartTime: 02:00:00 # Start time, precise to hour, minute, secondendTime: 06:00:00 # End time, precise to hour, minute, second- daysOfWeek: [ 3 ] # Days of weekstartTime: 01:00:00 # Start time, precise to hour, minute, secondendTime: 05:00:00 # End time, precise to hour, minute, second# Alarm rule detailsalarmRuleDetail:# Failure trigger timing 1 - First failure trigger 2 - All retries completed trigger (default)trigger: 1# Rerun/backfill failure trigger timing 1 - First failure trigger 2 - All retries completed trigger (default)dataBackfillOrRerunTrigger: 1# Timeout configuration detailstimeOutExtInfo:- ruleType: 1 # Timeout strategy: 1.estimated runtime, 2.estimated completion time, 3.estimated scheduling time, 4.not completed within cycle, 5.total waiting time, 6.waiting runtimetype: 1 # Timeout value type 1.specified value (default) 2.average valuehour: 1 # Timeout specified value hours (default 0)min: 30 # Timeout specified value minutes (default 1)scheduleTimeZone: UTC+7 # Configured timezone, defaults to project timezone# Backfill/rerun timeout configuration detailsdataBackfillOrRerunTimeOutExtInfo:- ruleType: 1 # Timeout strategy: 1.estimated runtime, 2.estimated completion time, 3.estimated scheduling time, 4.not completed within cycle, 5.total waiting time, 6.waiting runtimetype: 1 # Timeout value type 1.specified value (default) 2.average valuehour: 1 # Timeout specified value hours (default 0)min: 30 # Timeout specified value minutes (default 1)scheduleTimeZone: UTC+7 # Configured timezone, defaults to project timezone# Project fluctuation alarm configuration detailsprojectInstanceStatisticsAlarmInfoList:alarmType: projectFailureInstanceUpwardFluctuationAlarm # Failed instance upward fluctuation alarm, successful instance downward fluctuation alarminstanceThresholdCountPercent: 10 # Percentage of failed instances for the dayinstanceThresholdCount: 20 # Total threshold: daily failed instances, daily cumulative instances, daily failed instances upward fluctuation, cumulative instances fluctuation thresholdinstanceCount: 20 # Daily cumulative instances, daily failed instances downward fluctuationstabilizeStatisticsCycle: 3 # Stability statistics cycle (anti-jitter configuration statistics cycle count)isCumulate: false # Whether to calculate cumulatively, false: consecutive, true: cumulativestabilizeThreshold: 3 # Stability count threshold (anti-jitter configuration statistics cycle count)reconciliationExtInfo:- ruleType: reconciliationFailuremismatchCount: 1hour: 1min: 30
resources:events:eventResourceKey:name: eventName# Types include: MIN, HOUR, DAYeventSubType: MIN# Optional, if not filled, use default userownerName: asherxu# Event descriptiondescription: "description"# Event time to livetimeToLive: 1# Time to live unit: DAY, MINtimeUnit: DAYS# Event type: GENERAL, TIME_SERIESeventType: "TIME_SERIES"# Event broadcast type: SINGLE, BROADCASTeventBroadcastType: "BROADCAST"# Time formatdimensionFormat: "yyyymmdd"
#Install the WeData client (you need to download the installation package to your local machine and then run it).sudo sh install.sh#Install the WeData client (no installation package required, simply run the program).#Singapore area#macOS system installationcurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh#windows system installationcurl.exe -fsSL https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/windows/install.bat -o install.bat && install.bat
#Uninstall WeData clientsudo sh install.sh --uninstall
#Upgrade the currently installed client version to the latest version.sudo sh install.sh --upgrade#Update to the latest version#Singapore area#macOS system upgradecurl https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/linux/install.sh |sudo sh -s -- --upgrade#windows system upgratecurl.exe -fsSL https://wedata-agent-sg-1257305158.cos.ap-singapore.myqcloud.com/bundle/install-script/windows/install.bat -o install.bat && install.bat --upgrade
#Get the currently installed client versionwedata -vwedata --version
#Both commands can be used to log in.wedata auth login --host '${workspace-url}'wedata auth login
~/.wedata/wedata.json):wedata auth login
# Open the configuration file with an editorcode ~/.wedata/wedata.json# Or.vim ~/.wedata/wedata.json
{"version": 1,"tokens": {"<your UIN>": {"Token": "<EntraID token value>","SecretId": "<EntraID SecretId value>","SecretKey": "<EntraID SecretKey value>","ExpireTime": 1770242769,"AppId": "<Your AppId>","Uin": "<your UIN>","UserName": "<your Entra ID email address>","OwnerUserId": "<OwnerUserId>","Region": "ap-guangzhou","Language": "zh-CN","IsIntl": false}}}


wedata.json file, change the ExpireTime field value to **0**:ExpireTime to 0 to avoid the CLI tool denying the use of the Token due to expiration check, underwrite credential availability in CI/CD process.{"Token": "<your token>","SecretId": "<your SecretId>","SecretKey": "<your SecretKey>","ExpireTime": 0,...}

#Initialize a bundlewedata bundle init -p ${profile_name}
#Bundle initialization related commandswedata bundle generate task --existing-task-id ${task_id} -t dev/prod -p ${profile_name}wedata bundle generate workflow --existing-workflow-id ${workflow_id} -t dev/prod -p ${profile_name}wedata bundle generate event --existing-event-id ${event_id} -t dev/prod -p ${profile_name}wedata bundle generate alarm --existing-alarm-id ${alarm_id} -t dev/prod -p ${profile_name}wedata bundle generate resourceFile --existing-resourceFile-id ${resourceFile_id} -t dev/prod -p ${profile_name}wedata bundle generate projectParam --existing-projectParam-name ${projectParam_name} -t dev/prod -p ${profile_name}
#Bundle initialization related commandswedata bundle generate triggertask --existing-triggertask-id ${task_id} -t dev/prod -p ${profile_name}wedata bundle generate triggerworkflow --existing-triggerworkflow-id ${workflow_id} -t dev/prod -p ${profile_name}
#Resources are bound to local bundleswedata bundle deployment bind task ${resource key} ${task_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind workflow ${resource key} ${workflow_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind event ${resource key} ${event_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind alarm ${resource key} ${alarm_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind resourceFile ${resource key} ${resourceFile_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind projectParam ${resource key} ${projectParam_name} -t dev/prod -p ${profile_name}
#Resources are bound to local bundleswedata bundle deployment bind triggertask ${resource key} ${task_id} -t dev/prod -p ${profile_name}wedata bundle deployment bind triggerworkflow ${resource key} ${workflow_id} -t dev/prod -p ${profile_name}
#Unbind resources from local bundlewedata bundle deployment unbind task ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind workflow ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind event ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind alarm ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind resourceFile ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind wedataStudio ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind projectParam ${resource key} -t dev/prod -p ${profile_name}
#Unbind resources from local bundlewedata bundle deployment unbind triggertask ${resource key} -t dev/prod -p ${profile_name}wedata bundle deployment unbind triggerworkflow ${resource key} -t dev/prod -p ${profile_name}
wedata bundle run task ${resource key} -t dev/prod -p ${profile_name} #Run a specific taskwedata bundle run workflow ${resource key} -t dev/prod -p ${profile_name} #Run a specific workflow
wedata bundle run triggertask ${resource key} -t dev/prod -p ${profile_name} #Run a specific taskwedata bundle run triggerworkflow ${resource key} -t dev/prod -p ${profile_name} #Run a specific workflow
wedata bundle validate -t dev/prod -p ${profile_name} #Verify bundle and resource configuration
wedata bundle deploy -t dev/prod -p ${profile_name} -s true # Deploy the contents of the bundle to the corresponding environment
wedata bundle destroy -t dev/prod -p ${profile_name} #Destroy the contents deployed via bundle in the corresponding environment.
wedata auth describe #By default, it retrieves the information corresponding to the default profile.wedata auth describe -p ${profile_name} #Retrieve information corresponding to the specified profile.wedata auth describe --host sub_account #Retrieve the profile information corresponding to the current sub-account.wedata auth describe --sensitive #Outputs sensitive information (secret_id and secret_key). If not specified, secret_id and key will be displayed as ******
wedata bundle summary #Summary of the current package binding task status
wedata bundle -help # Display command help information
Feedback