From 282a5745af94e12c7e0e5b9671cd1f69f33a2dd8 Mon Sep 17 00:00:00 2001 From: Vikram Singh Date: Thu, 24 Oct 2024 18:47:10 +0530 Subject: [PATCH] delete unwanted files --- .../28901901_devtron_ci_trigger_v1_1.down.sql | 6 -- .../28901901_devtron_ci_trigger_v1_1.up.sql | 36 --------- scripts/sql/28901902_docker_lint.down.sql | 23 ------ scripts/sql/28901902_docker_lint.up.sql | 73 ------------------- scripts/sql/29001900_release_rbac.down.sql | 4 - scripts/sql/29001900_release_rbac.up.sql | 41 ----------- .../sql/29101900_notification_settings.up.sql | 2 - .../29101900_notification_stettings.down.sql | 1 - ...01900_helm_app_deployment_message.down.sql | 3 - ...9201900_helm_app_deployment_message.up.sql | 3 - 10 files changed, 192 deletions(-) delete mode 100644 scripts/sql/28901901_devtron_ci_trigger_v1_1.down.sql delete mode 100644 scripts/sql/28901901_devtron_ci_trigger_v1_1.up.sql delete mode 100644 scripts/sql/28901902_docker_lint.down.sql delete mode 100644 scripts/sql/28901902_docker_lint.up.sql delete mode 100644 scripts/sql/29001900_release_rbac.down.sql delete mode 100644 scripts/sql/29001900_release_rbac.up.sql delete mode 100644 scripts/sql/29101900_notification_settings.up.sql delete mode 100644 scripts/sql/29101900_notification_stettings.down.sql delete mode 100644 scripts/sql/29201900_helm_app_deployment_message.down.sql delete mode 100644 scripts/sql/29201900_helm_app_deployment_message.up.sql diff --git a/scripts/sql/28901901_devtron_ci_trigger_v1_1.down.sql b/scripts/sql/28901901_devtron_ci_trigger_v1_1.down.sql deleted file mode 100644 index d3ed16f788e..00000000000 --- a/scripts/sql/28901901_devtron_ci_trigger_v1_1.down.sql +++ /dev/null @@ -1,6 +0,0 @@ -DELETE FROM plugin_step_variable WHERE plugin_step_id=(SELECT id FROM plugin_metadata WHERE name='Devtron CI Trigger'); -DELETE FROM plugin_step where plugin_id=(SELECT id FROM plugin_metadata WHERE name='Devtron CI Trigger'); -DELETE FROM plugin_pipeline_script where id=(SELECT id FROM plugin_metadata WHERE name='Devtron CI Trigger'); -DELETE FROM plugin_stage_mapping where plugin_id=(SELECT id from plugin_metadata where name='Devtron CI Trigger'); -DELETE FROM plugin_metadata where name='Devtron CI Trigger'; -UPDATE plugin_metadata SET is_latest = true WHERE id = (SELECT id FROM plugin_metadata WHERE name= 'Devtron CI Trigger v1.0.0' and is_latest= false); diff --git a/scripts/sql/28901901_devtron_ci_trigger_v1_1.up.sql b/scripts/sql/28901901_devtron_ci_trigger_v1_1.up.sql deleted file mode 100644 index 9b120ceb431..00000000000 --- a/scripts/sql/28901901_devtron_ci_trigger_v1_1.up.sql +++ /dev/null @@ -1,36 +0,0 @@ -UPDATE plugin_metadata SET is_latest = false WHERE id = (SELECT id FROM plugin_metadata WHERE name= 'Devtron CI Trigger v1.0.0' and is_latest= true); - -INSERT INTO "plugin_metadata" ("id", "name", "description","deleted", "created_on", "created_by", "updated_on", "updated_by","plugin_parent_metadata_id","plugin_version","is_deprecated","is_latest") -VALUES (nextval('id_seq_plugin_metadata'), 'Devtron CI Trigger','Triggers the CI pipeline of Devtron Application','f', 'now()', 1, 'now()', 1, (SELECT id FROM plugin_parent_metadata WHERE identifier='devtron-ci-trigger-v1-0-0'),'1.1.0', false, true); - -INSERT INTO "plugin_stage_mapping" ("plugin_id","stage_type","created_on", "created_by", "updated_on", "updated_by") -VALUES ((SELECT id FROM plugin_metadata WHERE plugin_version='1.1.0' and name='Devtron CI Trigger' and deleted= false),0,'now()', 1, 'now()', 1); - -INSERT INTO "plugin_pipeline_script" ("id", "script","type","deleted","created_on", "created_by", "updated_on", "updated_by")VALUES ( - nextval('id_seq_plugin_pipeline_script'), - E'#!/bin/sh - docker run -e DevtronApiToken=$DevtronApiToken -e DevtronEndpoint=$DevtronEndpoint -e DevtronApp=$DevtronApp -e CiPipeline=$CiPipeline -e DevtronEnv=$DevtronEnv -e GitCommitHash=$GitCommitHash -e Timeout=$Timeout -e IgnoreCache=$IgnoreCache --name devtron-ci-trigger quay.io/devtron/devtron-utils:ci-trigger-plugin-v1.1.0 - exit_code=$? - if [ $ExitOnFail == true ];then - if [ $exit_code == 2 ];then - echo "The triggered build has been failed terminating the current process." - exit $exit_code - fi - fi - if [ $exit_code -ne 0 ] && [ $exit_code -ne 2 ] ; then - echo "The Docker container exited with code $exit_code. Terminating current process." - exit $exit_code - fi','SHELL','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='Devtron CI Trigger'),'Step 1','Runnig the plugin','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,default_value,value,variable_type,value_type,previous_step_index,variable_step_index,variable_step_index_in_plugin,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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'DevtronApiToken','STRING','Enter Devtron API Token with required permissions.','t','f',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'DevtronEndpoint','STRING','Enter the URL of Devtron Dashboard for.eg (https://devtron.example.com).','t','f',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'DevtronApp','STRING','Enter the name or ID of the Application whose build is to be triggered.','t','f',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'DevtronEnv','STRING','Enter the name or ID of the Environment to which the CI is attached. Required if CiPipeline is not given.','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'CiPipeline','STRING','Enter the name or ID of the CI pipeline to be triggered. Required if DevtronEnv is not given.','t','t',null,null,'INPUT','NEW',null,1,null,null, 'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'GitCommitHash','STRING','Enter the commit hash from which the build is to be triggered. If not given then will pick the latest.','t','t',null,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'Timeout','NUMBER','Enter the maximum time to wait for the build status.', 't','t',-1,null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1), -(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='Devtron CI Trigger' and ps."index"=1 and ps.deleted=false),'IgnoreCache','STRING','Set true if you want to ignore cache for the build.', 't','t','false',null,'INPUT','NEW',null,1,null,null,'f','now()',1,'now()',1); diff --git a/scripts/sql/28901902_docker_lint.down.sql b/scripts/sql/28901902_docker_lint.down.sql deleted file mode 100644 index da8a0ad9c88..00000000000 --- a/scripts/sql/28901902_docker_lint.down.sql +++ /dev/null @@ -1,23 +0,0 @@ -DELETE FROM plugin_step_variable WHERE plugin_step_id in (SELECT ps.id FROM plugin_metadata p inner JOIN plugin_step ps on ps.plugin_id=p.id WHERE p.plugin_version='1.0.0' and p.name='Docker Lint' and p.deleted=false and ps."index"=1 and ps.deleted=false); - - -DELETE FROM plugin_step WHERE plugin_id = (SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted=false); - - -DELETE FROM plugin_stage_mapping WHERE plugin_id =(SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted=false); - - -DELETE FROM plugin_tag_relation WHERE plugin_id in (SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted=false); - -DELETE FROM pipeline_stage_step_variable where pipeline_stage_step_id in (select id from pipeline_stage_step where name = 'Docker Lint') ; - -DELETE FROM pipeline_stage_step where ref_plugin_id in (SELECT id from plugin_metadata WHERE plugin_version='1.0.0' and name ='Docker Lint' and deleted=false); - - -DELETE from plugin_pipeline_script where id = (SELECT script_id from plugin_step WHERE plugin_id=(SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted=false)); - - -DELETE FROM plugin_metadata WHERE plugin_version='1.0.0' and name ='Docker Lint' and deleted=false; - - -DELETE FROM plugin_parent_metadata WHERE identifier ='docker-lint'; \ No newline at end of file diff --git a/scripts/sql/28901902_docker_lint.up.sql b/scripts/sql/28901902_docker_lint.up.sql deleted file mode 100644 index af3901e6718..00000000000 --- a/scripts/sql/28901902_docker_lint.up.sql +++ /dev/null @@ -1,73 +0,0 @@ -INSERT INTO "plugin_parent_metadata" ("id", "name","identifier", "description","type","icon","deleted", "created_on", "created_by", "updated_on", "updated_by") -VALUES (nextval('id_seq_plugin_parent_metadata'), 'Docker Lint','docker-lint','This is used to analyze the Dockerfile and offer suggestions for improvements','PRESET','https://raw.githubusercontent.com/devtron-labs/devtron/main/assets/hadolint.png','f', 'now()', 1, 'now()', 1); - - -UPDATE plugin_metadata SET is_latest = false WHERE id = (SELECT id FROM plugin_metadata WHERE name= 'Docker Lint' and is_latest= true); - - -INSERT INTO "plugin_metadata" ("id", "name", "description","deleted", "created_on", "created_by", "updated_on", "updated_by","plugin_parent_metadata_id","plugin_version","is_deprecated","is_latest") -VALUES (nextval('id_seq_plugin_metadata'), 'Docker Lint','This is used to analyze the Dockerfile and offer suggestions for improvements','f', 'now()', 1, 'now()', 1, (SELECT id FROM plugin_parent_metadata WHERE identifier='docker-lint'),'1.0.0', false, true); - - -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='Security') , (SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted= false),'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='DevSecOps') , (SELECT id FROM plugin_metadata WHERE plugin_version='1.0.0' and name='Docker Lint' and deleted= false),'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 plugin_version='1.0.0' and name='Docker Lint' and deleted= false),3,'now()', 1, 'now()', 1); - -INSERT INTO "plugin_pipeline_script" ("id", "script","type","deleted","created_on", "created_by", "updated_on", "updated_by") -VALUES ( - nextval('id_seq_plugin_pipeline_script'), - E' - set -ex - arch=$(uname -m) - os=$(uname -s) - echo $arch - echo $os - command=$(wget https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-$os-$arch) - echo $command - docker_path="Dockerfile" - echo $docker_path - if [ ! -z "$DockerFilePath" ] - then - docker_path=$DockerFilePath - fi - echo $docker_path - cp hadolint-Linux-x86_64 hadolint - chmod +x hadolint - if [[ $FailOnError == "true" ]] - then - ./hadolint "/devtroncd/$docker_path" - else - ./hadolint "/devtroncd/$docker_path" --no-fail - fi - -', - 'SHELL', - '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 plugin_version='1.0.0' and name='Docker Lint' and deleted= false),'Step 1','Step 1 - Triggering Docker Lint','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","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.plugin_version='1.0.0' and p.name='Docker Lint' and p.deleted=false and ps."index"=1 and ps.deleted=false), 'DockerFilePath','STRING','Specify the file path to the Dockerfile for linting. Default path is Dockerfile if not specified',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","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.plugin_version='1.0.0' and p.name='Docker Lint' and p.deleted=false and ps."index"=1 and ps.deleted=false), 'FailOnError','STRING','Pass true/false to fail/pass the pipeline on error in docker lint',true,false,'INPUT','NEW','false',1 ,'f','now()', 1, 'now()', 1); - diff --git a/scripts/sql/29001900_release_rbac.down.sql b/scripts/sql/29001900_release_rbac.down.sql deleted file mode 100644 index 82053ba8896..00000000000 --- a/scripts/sql/29001900_release_rbac.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE roles DROP COLUMN "release"; -ALTER TABLE roles DROP COLUMN "release_track"; -DELETE from rbac_role_resource_detail where resource in ('release','release-track'); -DELETE from rbac_policy_resource_detail where resource in ('release','release-track'); \ No newline at end of file diff --git a/scripts/sql/29001900_release_rbac.up.sql b/scripts/sql/29001900_release_rbac.up.sql deleted file mode 100644 index 6f4e61114dd..00000000000 --- a/scripts/sql/29001900_release_rbac.up.sql +++ /dev/null @@ -1,41 +0,0 @@ - -INSERT INTO rbac_policy_resource_detail ("resource", "policy_resource_value", "allowed_actions", - "resource_object", "eligible_entity_access_types", "deleted", "created_on", - "created_by", "updated_on", "updated_by") -VALUES ('release', '{"value": "release", "indexKeyMap": {}}', ARRAY['get','update','create','delete','patch'],'{"value": "%/%", "indexKeyMap": {"0": "ReleaseTrackObj", "2": "ReleaseObj"}}', ARRAY['release'],'f','now()', 1, 'now()', 1); - -INSERT INTO rbac_policy_resource_detail ("resource", "policy_resource_value", "allowed_actions", - "resource_object", "eligible_entity_access_types", "deleted", "created_on", - "created_by", "updated_on", "updated_by") -VALUES ('release-requirement', '{"value": "release-requirement", "indexKeyMap": {}}', ARRAY['get','update','create','delete','patch'],'{"value": "%/%", "indexKeyMap": {"0": "ReleaseTrackObj", "2": "ReleaseObj"}}', ARRAY['release'],'f','now()', 1, 'now()', 1); - -INSERT INTO rbac_policy_resource_detail ("resource", "policy_resource_value", "allowed_actions", - "resource_object", "eligible_entity_access_types", "deleted", "created_on", - "created_by", "updated_on", "updated_by") -VALUES ('release-track', '{"value": "release-track", "indexKeyMap": {}}', ARRAY['get','update','create','delete','patch'],'{"value": "%", "indexKeyMap": {"0": "ReleaseTrackObj"}}', ARRAY['release'],'f','now()', 1, 'now()', 1); - -INSERT INTO rbac_policy_resource_detail ("resource", "policy_resource_value", "allowed_actions", - "resource_object", "eligible_entity_access_types", "deleted", "created_on", - "created_by", "updated_on", "updated_by") -VALUES ('release-track-requirement', '{"value": "release-track-requirement", "indexKeyMap": {}}', ARRAY['get','update','create','delete','patch'],'{"value": "%", "indexKeyMap": {"0": "ReleaseTrackObj"}}', ARRAY['release'],'f','now()', 1, 'now()', 1); - - - - - -INSERT INTO rbac_role_resource_detail ("resource", "role_resource_key", "role_resource_update_key", - "eligible_entity_access_types", "deleted", "created_on", "created_by", - "updated_on", "updated_by") -VALUES ('release', 'Release', 'Release', ARRAY ['release'], false, now(), 1, now(), 1); - - -INSERT INTO rbac_role_resource_detail ("resource", "role_resource_key", "role_resource_update_key", - "eligible_entity_access_types", "deleted", "created_on", "created_by", - "updated_on", "updated_by") -VALUES ('release-track', 'ReleaseTrack', 'ReleaseTrack', ARRAY ['release'], false, now(), 1, now(), 1); - - - - -ALTER TABLE roles ADD COLUMN IF NOT EXISTS "release" text; -ALTER TABLE roles ADD COLUMN IF NOT EXISTS "release_track" text; \ No newline at end of file diff --git a/scripts/sql/29101900_notification_settings.up.sql b/scripts/sql/29101900_notification_settings.up.sql deleted file mode 100644 index cbe10af1a07..00000000000 --- a/scripts/sql/29101900_notification_settings.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE notification_settings drop constraint IF EXISTS notification_settings_env_id_fkey; -ALTER TABLE notification_settings ADD COLUMN IF NOT EXISTS cluster_id INT; diff --git a/scripts/sql/29101900_notification_stettings.down.sql b/scripts/sql/29101900_notification_stettings.down.sql deleted file mode 100644 index 045fc2f80d9..00000000000 --- a/scripts/sql/29101900_notification_stettings.down.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE notification_settings DROP COLUMN IF EXISTS cluster_id INT; \ No newline at end of file diff --git a/scripts/sql/29201900_helm_app_deployment_message.down.sql b/scripts/sql/29201900_helm_app_deployment_message.down.sql deleted file mode 100644 index 25eb9b043aa..00000000000 --- a/scripts/sql/29201900_helm_app_deployment_message.down.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Drop the message column from the "public"."installed_app_version_history" table -ALTER TABLE "public"."installed_app_version_history" - DROP COLUMN IF EXISTS message; \ No newline at end of file diff --git a/scripts/sql/29201900_helm_app_deployment_message.up.sql b/scripts/sql/29201900_helm_app_deployment_message.up.sql deleted file mode 100644 index 8d08f591750..00000000000 --- a/scripts/sql/29201900_helm_app_deployment_message.up.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Add message column to "public"."installed_app_version_history" table -ALTER TABLE "public"."installed_app_version_history" - ADD COLUMN IF NOT EXISTS message TEXT; \ No newline at end of file