summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2015-07-13 10:40:12 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2015-07-13 10:40:12 +0000
commit4841977167eee77bc81552957716ac9c140120d2 (patch)
tree867549b6a88bb505845d161eeaf571298684a7a0 /db/migrate
parentc48a043c0fee94a33ef0c3bc1d74c2a494ba71e9 (diff)
parent49ee28e1075f8c92b34933c934a4e1c6e37b41cd (diff)
downloadgitlab-ci-4841977167eee77bc81552957716ac9c140120d2.tar.gz
Merge branch 'build-types' into 'master'
Allow to specify flexible list of types in yaml First part of flexible pipeline build in GitLab CI Having following `.gitlab-ci.yml`: ``` types: - test - deploy - notify rspec: script: "rspec" rubocop: script: "rubocop" staging: type: deploy script: "echo deploy" only: - master production: type: deploy script: "echo production" only: - tags dockerhub: type: notify script: "curl http://docker/hub/web/hook" downstream: type: notify script: "curl http://build/downstream/jobs" ``` GitLab CI will trigger two test jobs in parallel, when finished it will trigged either staging or production, when finished it will trigger dockerhub and downstream in parallel. The UI (screenshots are not for above YAML): ![Screen_Shot_2015-07-10_at_15.56.26](https://gitlab.com/gitlab-org/gitlab-ci/uploads/1f714b73772cf0d44168fb8e20e35561/Screen_Shot_2015-07-10_at_15.56.26.png) ![Screen_Shot_2015-07-10_at_15.57.19](https://gitlab.com/gitlab-org/gitlab-ci/uploads/fc9f458f2ca517d923a4382466fa99eb/Screen_Shot_2015-07-10_at_15.57.19.png) TODO: - [x] Implement in CI - [x] Specs - [x] Changelog - [x] CI tests - [ ] Documentation /cc @vsizov @sytses @dzaporozhets See merge request !198
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20150710113836_add_job_type_to_builds.rb5
-rw-r--r--db/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb6
2 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/20150710113836_add_job_type_to_builds.rb b/db/migrate/20150710113836_add_job_type_to_builds.rb
new file mode 100644
index 0000000..2829a0d
--- /dev/null
+++ b/db/migrate/20150710113836_add_job_type_to_builds.rb
@@ -0,0 +1,5 @@
+class AddJobTypeToBuilds < ActiveRecord::Migration
+ def change
+ add_column :builds, :job_type, :string
+ end
+end
diff --git a/db/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb b/db/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb
new file mode 100644
index 0000000..2690fc1
--- /dev/null
+++ b/db/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb
@@ -0,0 +1,6 @@
+class MigrateDeployToJobTypeForBuilds < ActiveRecord::Migration
+ def up
+ execute("UPDATE builds SET job_type='test' WHERE NOT deploy")
+ execute("UPDATE builds SET job_type='deploy' WHERE deploy")
+ end
+end