summaryrefslogtreecommitdiff
path: root/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb
diff options
context:
space:
mode:
authorKrasimir Angelov <kangelov@gitlab.com>2019-05-06 13:11:42 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-05-06 13:11:42 +0000
commit85609c117e2b96a786204069669c66d36d971733 (patch)
treee177a1fa0ddd9caa6cf4dab35c22a0ff94e66880 /db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb
parent4d2d812463256003ab943df90a9c603821078a69 (diff)
downloadgitlab-ce-85609c117e2b96a786204069669c66d36d971733.tar.gz
Implement support for CI variables of type file
Add env_var and file as supported types for CI variables. Variables of type file expose to users existing gitlab-runner behaviour - save variable value into a temp file and set the path to this file in an ENV var named after the variable key. Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/46806.
Diffstat (limited to 'db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb')
-rw-r--r--db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb b/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb
new file mode 100644
index 00000000000..3079b2afd9c
--- /dev/null
+++ b/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddVariableTypeToCiPipelineScheduleVariables < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+ disable_ddl_transaction!
+
+ DOWNTIME = false
+ ENV_VAR_VARIABLE_TYPE = 1
+
+ def up
+ add_column_with_default(:ci_pipeline_schedule_variables, :variable_type, :smallint, default: ENV_VAR_VARIABLE_TYPE)
+ end
+
+ def down
+ remove_column(:ci_pipeline_schedule_variables, :variable_type)
+ end
+end