Custom Build
- POST
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
- /:pipeline_id
- /actions
Creates a new Custom Build action in the pipeline
Request example
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Build Android app",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "library/openjdk",
"docker_image_tag": "8",
"volume_mappings": [
"/:/buddy/mount/directory"
],
"execute_commands": [
"export ANDROID_HOME=/opt/android/sdk",
"chmod +x gradlew",
"./gradlew assembleRelease"
],
"setup_commands": [
"mkdir -p /opt/android/sdk && mkdir .android",
"cd /opt/android/sdk && curl -o sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip && unzip sdk.zip && rm sdk.zip",
"yes | /opt/android/sdk/tools/bin/sdkmanager --licenses",
"/opt/android/sdk/tools/bin/sdkmanager --update",
"/opt/android/sdk/tools/bin/sdkmanager platform-tools",
"/opt/android/sdk/tools/bin/sdkmanager tools",
"/opt/android/sdk/tools/bin/sdkmanager emulator",
"/opt/android/sdk/tools/bin/sdkmanager \"extras;android;m2repository\"",
"/opt/android/sdk/tools/bin/sdkmanager \"extras;google;m2repository\"",
"/opt/android/sdk/tools/bin/sdkmanager \"extras;google;google_play_services\"",
"/opt/android/sdk/tools/bin/sdkmanager \"build-tools;27.0.3\"",
"/opt/android/sdk/tools/bin/sdkmanager \"platforms;android-27\""
],
"working_directory": "/buddy/my-repo-dir"
}'EXAMPLE RESPONSE
{
"url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/pipelines/791/actions/1233",
"html_url": "https://app.buddy.works/my-workspace/my-project/pipelines/pipeline/791/action/1233/edit",
"id": 1233,
"name": "mvn artifact",
"type": "BUILD",
"current_revision": "58e239079a2161fec0ba96ed166557157ad3dd79",
"trigger_time": "ON_EVERY_EXECUTION",
"run_next": "WAIT_ON_SUCCESS",
"disabled": false,
"ignore_errors": false,
"pipeline": {
"url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/pipelines/791",
"html_url": "https://app.buddy.works/my-workspace/my-project/pipelines/pipeline/791",
"id": 791,
"identifier": "build",
"name": "build",
"definition_source": "LOCAL",
"git_config_ref": "NONE",
"refs": [
"refs/heads/master"
],
"events": [
{
"type": "WEBHOOK"
}
],
"priority": "NORMAL",
"disabled": false,
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "58e239079a2161fec0ba96ed166557157ad3dd79",
"always_from_scratch": false,
"ignore_fail_on_project_status": false,
"strict_context": false,
"skip_queued_runs": "SAME_REF",
"cancel_inprogress_runs": "NEVER",
"auto_clear_cache": false,
"fetch_all_refs": false,
"fail_on_prepare_env_warning": true,
"concurrent_pipeline_runs": false,
"do_not_create_commit_status": false,
"stale": false,
"waiting_for_push": false,
"resources": "DEFAULT",
"git_changeset_base": "LATEST_RUN",
"filesystem_changeset_base": "DATE_MODIFIED",
"cpu": "X64",
"description_required": false
},
"loop": [],
"docker_image_name": "library/maven",
"docker_image_tag": "3.9.9",
"execute_commands": [
"mvn artifact"
],
"mount_filesystem_disable": false,
"volume_mappings": [
"/:/buddy/my-project"
],
"cached_dirs": [
"/root/.m2/repository"
],
"shell": "BASH",
"region": "",
"image_location": "PUBLIC_REGISTRY",
"docker_registry": "DOCKER_HUB",
"execute_every_command": false,
"ignore_image_pull_failures": false,
"cache_base_image": true,
"reset_entrypoint": false,
"vt_suite": ""
}STATUS
200 OK