-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Jenkins plugin migration (#4039)
* wip * wip * jenkins plugin up script * down script * script sequence fix * jenkins migration script * reverting irrelevant changes * variable description update * variable description update * variable description update * updating image * fix description * sql script fix * jenkins plugin latest image * jenkins script updated
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DELETE FROM plugin_step_variable WHERE plugin_step_id =(SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false); | ||
DELETE from plugin_pipeline_script where id = (SELECT script_id from plugin_step WHERE plugin_id=(SELECT id FROM plugin_metadata WHERE name='Jenkins')); | ||
DELETE FROM plugin_step WHERE plugin_id = (SELECT id FROM plugin_metadata WHERE name='Jenkins'); | ||
DELETE FROM plugin_stage_mapping WHERE plugin_id =(SELECT id FROM plugin_metadata WHERE name='Jenkins'); | ||
DELETE FROM plugin_tag_relation WHERE plugin_id =(SELECT id FROM plugin_metadata WHERE name='Jenkins'); | ||
DELETE FROM pipeline_stage_step_variable WHERE pipeline_stage_step_id in (SELECT id FROM pipeline_stage_step where ref_plugin_id =(SELECT id from plugin_metadata WHERE name ='Jenkins')); | ||
DELETE FROM pipeline_stage_step where ref_plugin_id in (SELECT id from plugin_metadata WHERE name ='Jenkins'); | ||
DELETE FROM plugin_metadata WHERE name ='Jenkins'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
INSERT INTO "plugin_metadata" ("id", "name", "description","type","icon","deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_metadata'), 'Jenkins','','PRESET','https://raw.githubusercontent.com/devtron-labs/devtron/main/assets/jenkins.png','f', 'now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_tag" ("id", "name", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_tag'), 'CI task','f', 'now()',1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_tag_relation" ("id", "tag_id", "plugin_id", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_tag_relation'),(SELECT id FROM plugin_tag WHERE name='CI task') , (SELECT id FROM plugin_metadata WHERE name='Jenkins'),'now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_stage_mapping" ("plugin_id","stage_type","created_on", "created_by", "updated_on", "updated_by") | ||
VALUES ((SELECT id FROM plugin_metadata WHERE name='Jenkins'),0,'now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_pipeline_script" ("id","type","mount_directory_from_host","container_image_path","deleted","created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_pipeline_script'),'CONTAINER_IMAGE','t','quay.io/devtron/jenkins-plugin:1fc6bfda-549-18503','f','now()',1,'now()',1); | ||
|
||
INSERT INTO "plugin_step" ("id", "plugin_id","name","description","index","step_type","script_id","deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step'), (SELECT id FROM plugin_metadata WHERE name='Jenkins'),'Step 1','Step 1 - Triggering Jenkins Job','1','INLINE',(SELECT last_value FROM id_seq_plugin_pipeline_script),'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value", "variable_type", "value_type", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'URL','STRING','Jenkins account url',true,true,'INPUT','NEW',1 ,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'USERNAME','STRING','Jenkins account username',true,true,'INPUT','NEW',1 ,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'PASSWORD','STRING','Jenkins account password/token',true,true,'INPUT','NEW',1 ,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'JOB_NAME','STRING','Jenkins job name',true,true,'INPUT','NEW',1 ,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'JOB_TRIGGER_PARAMS','STRING', | ||
'Jenkins job parameters (optional). | ||
Provide in format:- | ||
{"key1":"val1/variable"}. | ||
Available variables:- | ||
GIT_MATERIAL_REPO, | ||
GIT_MATERIAL_CHECKOUT_PATH, | ||
GIT_MATERIAL_BRANCH, | ||
GIT_MATERIAL_COMMIT_HASH',true,true,'INPUT','NEW',1 ,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value","variable_type", "value_type", "variable_step_index",reference_variable_name, "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false), 'GIT_MATERIAL_REQUEST','STRING','',false,true,'INPUT','GLOBAL',1 ,'GIT_MATERIAL_REQUEST','f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value", "variable_type", "value_type","default_value", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false),'JENKINS_PLUGIN_TIMEOUT','NUMBER','Jenkins plugin timeout duration','t','t','INPUT','NEW',45,1,'f','now()', 1, 'now()', 1); | ||
|
||
INSERT INTO "plugin_step_variable" ("id", "plugin_step_id", "name", "format", "description", "is_exposed", "allow_empty_value", "variable_type", "value_type","default_value", "variable_step_index", "deleted", "created_on", "created_by", "updated_on", "updated_by") | ||
VALUES (nextval('id_seq_plugin_step_variable'), (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.name='Jenkins' and ps."index"=1 and ps.deleted=false),'BUILD_STATUS_POLL_DURATION','NUMBER','Jenkins build status polling duration','f','t','INPUT','NEW',1,1,'f','now()', 1, 'now()', 1); |