From a138d618c4718d50e5231aaeb0ed19e9f518a834 Mon Sep 17 00:00:00 2001 From: Anton Lubin Date: Fri, 3 Feb 2023 19:29:22 +0500 Subject: [PATCH] [#377] Delete old fields --- .../api/cli/v1/deployment/create_form.rb | 2 -- .../api/cli/v1/deployment/update_form.rb | 2 -- .../builders/container_builder_service.rb | 2 -- .../continuous_preview_parser_service.rb | 2 -- core/test/factories/repos.rb | 2 -- uffizzi-compose-example.yml | 18 ++++++++---------- 6 files changed, 8 insertions(+), 20 deletions(-) diff --git a/core/app/forms/uffizzi_core/api/cli/v1/deployment/create_form.rb b/core/app/forms/uffizzi_core/api/cli/v1/deployment/create_form.rb index 8c3e03dc..cb708996 100644 --- a/core/app/forms/uffizzi_core/api/cli/v1/deployment/create_form.rb +++ b/core/app/forms/uffizzi_core/api/cli/v1/deployment/create_form.rb @@ -34,8 +34,6 @@ class UffizziCore::Api::Cli::V1::Deployment::CreateForm < UffizziCore::Deploymen :kind, :dockerfile_path, :dockerfile_context_path, - :deploy_preview_when_pull_request_is_opened, - :delete_preview_when_pull_request_is_closed, :deploy_preview_when_image_tag_is_created, :delete_preview_when_image_tag_is_updated, :share_to_github, diff --git a/core/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb b/core/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb index e20ca37e..083ab0e7 100644 --- a/core/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb +++ b/core/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb @@ -33,8 +33,6 @@ class UffizziCore::Api::Cli::V1::Deployment::UpdateForm < UffizziCore::Deploymen :kind, :dockerfile_path, :dockerfile_context_path, - :deploy_preview_when_pull_request_is_opened, - :delete_preview_when_pull_request_is_closed, :deploy_preview_when_image_tag_is_created, :delete_preview_when_image_tag_is_updated, :share_to_github, diff --git a/core/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb b/core/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb index bb85a647..c03e901f 100644 --- a/core/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb +++ b/core/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb @@ -86,8 +86,6 @@ def build_repo_attributes(container_data) def set_continuous_preview_attributes_to_repo(repo_attributes, global_data, container_data) condition_attributes = [ - :deploy_preview_when_pull_request_is_opened, - :delete_preview_when_pull_request_is_closed, :deploy_preview_when_image_tag_is_created, :delete_preview_when_image_tag_is_updated, :share_to_github, diff --git a/core/app/services/uffizzi_core/compose_file/parsers/continuous_preview_parser_service.rb b/core/app/services/uffizzi_core/compose_file/parsers/continuous_preview_parser_service.rb index 5ccb15ce..2cb3223d 100644 --- a/core/app/services/uffizzi_core/compose_file/parsers/continuous_preview_parser_service.rb +++ b/core/app/services/uffizzi_core/compose_file/parsers/continuous_preview_parser_service.rb @@ -6,8 +6,6 @@ def parse(continuous_preview_data) return {} if continuous_preview_data.nil? { - deploy_preview_when_pull_request_is_opened: trigger_value(continuous_preview_data, 'deploy_preview_when_pull_request_is_opened'), - delete_preview_when_pull_request_is_closed: trigger_value(continuous_preview_data, 'delete_preview_when_pull_request_is_closed'), deploy_preview_when_image_tag_is_created: trigger_value(continuous_preview_data, 'deploy_preview_when_image_tag_is_created'), delete_preview_when_image_tag_is_updated: trigger_value(continuous_preview_data, 'delete_preview_when_image_tag_is_updated'), delete_preview_after: delete_preview_after_value(continuous_preview_data['delete_preview_after']), diff --git a/core/test/factories/repos.rb b/core/test/factories/repos.rb index f8ef905b..66e5383b 100644 --- a/core/test/factories/repos.rb +++ b/core/test/factories/repos.rb @@ -9,8 +9,6 @@ branch description repository_id { generate(:number) } - deploy_preview_when_pull_request_is_opened { false } - delete_preview_when_pull_request_is_closed { false } deploy_preview_when_image_tag_is_created { false } delete_preview_when_image_tag_is_updated { false } delete_preview_after { nil } diff --git a/uffizzi-compose-example.yml b/uffizzi-compose-example.yml index 292568f8..e64d80d0 100644 --- a/uffizzi-compose-example.yml +++ b/uffizzi-compose-example.yml @@ -37,14 +37,12 @@ services: context: https://github.com/UffizziCloud/example-voting-result:main dockerfile: Dockerfile -continuous_preview: - deploy_preview_when_pull_request_is_opened: false - delete_preview_when_pull_request_is_closed: false - deploy_preview_for_image_tag_PR_#-branchname: true - delete_preview_when_pull_request_is_closed: false - delete_preview_in_x_hours: 24 - share_to_github: true +x-uffizzi: + continuous_preview: + deploy_preview_when_image_tag_is_created: true + delete_preview_after: 24 + share_to_github: true -ingress: - service: nginx - port: 8080 + ingress: + service: nginx + port: 8080