summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-06-18 13:09:53 +0000
committerValery Sizov <valery@gitlab.com>2015-06-18 13:09:53 +0000
commite7e4dc5f76fc48c25d76ed82a02b0fa1985bb845 (patch)
treebcdc01e63f7bb47cdc81bb34ecac9d38852ff328
parent18f4faa0de065ffb8557563acebc46748d7a1bf7 (diff)
parentb79cfa12b7bbcc53cdb5b44cb95457a1d05dd180 (diff)
downloadgitlab-ci-e7e4dc5f76fc48c25d76ed82a02b0fa1985bb845.tar.gz
Merge branch 'master_to-7_12_stable' into '7-12-stable'
Master to 7-12 stable See merge request !161
-rw-r--r--CHANGELOG1
-rw-r--r--db/migrate/20150601043227_migrate_jobs_to_yaml.rb16
-rw-r--r--doc/builds_configuration/README.md3
-rw-r--r--doc/examples/README.md20
-rw-r--r--doc/examples/configure/ruby.md7
5 files changed, 36 insertions, 11 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f3d61d6..8d417cb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@ v7.12.0
- Updated rails to 4.1.11
- API fix: project create call
- Link to web-editor with .gitlab-ci.yml
+ - Updated examples in the documentation
v7.11.0
- Deploy Jobs API calls
diff --git a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
index e7cdf2b..56570e2 100644
--- a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
+++ b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
@@ -22,6 +22,14 @@ class MigrateJobsToYaml < ActiveRecord::Migration
AND job_type = 'parallel'
GROUP BY j.id"
+ # skip_refs migrate
+ skip_refs = []
+
+ if project["skip_refs"].present?
+ skip_refs = project["skip_refs"].split(",").map(&:strip).select{|ref| ref =~ /^[\w-]*\Z/ }
+ end
+
+
# Create Jobs
select_all(sql).each do |job|
config[job["name"].to_s] = {
@@ -30,8 +38,9 @@ class MigrateJobsToYaml < ActiveRecord::Migration
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
- if except
+ if except.any?
config[job["name"].to_s][:except] = except
end
end
@@ -45,8 +54,9 @@ class MigrateJobsToYaml < ActiveRecord::Migration
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
- if except
+ if except.any?
config[job["name"].to_s][:except] = except
end
end
@@ -78,6 +88,6 @@ class MigrateJobsToYaml < ActiveRecord::Migration
return ["tags"]
end
- false
+ []
end
end
diff --git a/doc/builds_configuration/README.md b/doc/builds_configuration/README.md
index f7405d7..653e32d 100644
--- a/doc/builds_configuration/README.md
+++ b/doc/builds_configuration/README.md
@@ -104,3 +104,6 @@ except:
## Debugging of your builds with .gitlab-ci.yml
Each instance of GitLab CI has an embeded debug tool Lint. You can find link to the Lint in the projects settings page or use short url `/lint`.
+
+## Skipping builds
+There is one more way to skip all builds, if your commit message contains tag [ci skip]. In this case commit will be created but builds will be skipped.
diff --git a/doc/examples/README.md b/doc/examples/README.md
index 1e11a7e..444d68b 100644
--- a/doc/examples/README.md
+++ b/doc/examples/README.md
@@ -13,10 +13,22 @@ The runner runs the line below before it runs the commands in your build script:
# Environmental variables
-The build command is run from [GitlabCi::Build#command](https://gitlab.com/gitlab-org/gitlab-ci-runner/blob/master/lib/build.rb#L96) and contains the following environmental variables:
-
- CI_SERVER, CI_SERVER_NAME, CI_SERVER_VERSION, CI_SERVER_REVISION
- CI_BUILD_REF, CI_BUILD_BEFORE_SHA, CI_BUILD_REF_NAME (branch), CI_BUILD_ID
+The runner sets the following environmental variables:
+
+```
+CI=true
+CI_SERVER=true
+CI_SERVER_NAME=GitLab CI
+GITLAB_CI=true
+CI_SERVER_VERSION
+CI_SERVER_REVISION
+CI_BUILD_REF
+CI_BUILD_BEFORE_SHA
+CI_BUILD_REF_NAME (branch)
+CI_BUILD_ID
+CI_BUILD_REPO
+CI_PROJECT_DIR
+```
# Build script examples
diff --git a/doc/examples/configure/ruby.md b/doc/examples/configure/ruby.md
index 466e87e..3ecdaac 100644
--- a/doc/examples/configure/ruby.md
+++ b/doc/examples/configure/ruby.md
@@ -18,9 +18,8 @@ curl -L https://www.chef.io/chef/install.sh | bash
chef-client -z -r 'recipe[cookbook-gitlab-test::ruby], recipe[cookbook-gitlab-test::mysql]'
)
+
### Register your runner instance with a GitLab CI Coordinator
-sudo /opt/gitlab-runner/bin/setup -C /home/gitlab-runner
+gitlab-ci-multi-runner register
-# Restart the gitlab-runner Upstart script
-sudo service gitlab-runner restart
-```
+``` \ No newline at end of file