class WarpEngine::Build::ConfigsController
Generates CI pipeline configs for marker repos (a config holding only a platform: key and options) through the CI adapter’s pipeline_config.
Public Instance Methods
Source
# File app/controllers/warp_engine/build/configs_controller.rb, line 53 def create unless ci.verify_config_request(request) return render json: { error: "Invalid signature" }, status: :forbidden end marker = ci.config_marker(params) return head :no_content if marker.nil? config = render_config(platform: marker[:platform], name: marker[:name], options: marker[:options]) if config.nil? return render json: { error: "Unknown platform: #{marker[:platform]}" }, status: :unprocessable_entity end response = if marker[:others].present? ci.config_response(platform: marker[:platform], config: config, others: marker[:others]) else ci.config_response(platform: marker[:platform], config: config) end render json: response end
POST /build/config, the CI server’s configuration extension.
Responds 403 when the CI adapter rejects the request signature, and 204 when the repo’s config is not a marker, so the repo’s own config runs. For a marker, renders the adapter’s config response with the generated pipeline in place of the marker (and the repo’s other config files as they are), or 422 when the marker names an unknown platform.
Source
# File app/controllers/warp_engine/build/configs_controller.rb, line 26 def show config = render_config(platform: params[:platform], name: params[:name].presence || "example", options: params[:options].respond_to?(:to_unsafe_h) ? params[:options].to_unsafe_h : {}) return render json: { error: "Unknown platform" }, status: :not_found if config.nil? render plain: config, content_type: "text/yaml" end
GET /build/config.
- platform
-
the platform whose pipeline to render
- name
-
the software name to put in it,
exampleby default - options
-
marker options the platform’s pipeline reads
Renders the generated pipeline as text/yaml, or 404 for a platform the CI adapter does not serve.