@@ -69,9 +72,10 @@ const repo = inject('repo');
const router = useRouter();
-const payload = ref<{ id: string; environment: string; variables: { name: string; value: string }[] }>({
+const payload = ref<{ id: string; environment: string; task: string; variables: { name: string; value: string }[] }>({
id: '',
environment: '',
+ task: '',
variables: [
{
name: '',
diff --git a/web/src/lib/api/index.ts b/web/src/lib/api/index.ts
index 6c994ed7b56..13fdde5ccf8 100644
--- a/web/src/lib/api/index.ts
+++ b/web/src/lib/api/index.ts
@@ -31,6 +31,7 @@ type PipelineOptions = {
type DeploymentOptions = {
id: string;
environment: string;
+ task: string;
variables: Record
;
};
@@ -89,12 +90,13 @@ export default class WoodpeckerClient extends ApiClient {
}
// Deploy triggers a deployment for an existing pipeline using the
- // specified target environment.
+ // specified target environment and task.
deployPipeline(repoId: number, pipelineNumber: string, options: DeploymentOptions): Promise {
const vars = {
...options.variables,
event: 'deployment',
deploy_to: options.environment,
+ deploy_task: options.task,
};
const query = encodeQueryString(vars);
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}?${query}`) as Promise;