Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
059d8263
Commit
059d8263
authored
Feb 03, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ci configuration to send slack notifications on failure and added rake task
parent
49402844
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
.gitlab-ci.yml
.gitlab-ci.yml
+32
-1
lib/tasks/ci/slack.rake
lib/tasks/ci/slack.rake
+9
-0
No files found.
.gitlab-ci.yml
View file @
059d8263
...
...
@@ -19,7 +19,12 @@ before_script:
-
bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
-
RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
stages
:
-
test
-
notifications
spec:feature:
stage
:
test
script
:
-
RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
...
...
@@ -28,6 +33,7 @@ spec:feature:
-
mysql
spec:api:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
tags
:
...
...
@@ -35,6 +41,7 @@ spec:api:
-
mysql
spec:models:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
tags
:
...
...
@@ -42,6 +49,7 @@ spec:models:
-
mysql
spec:lib:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
tags
:
...
...
@@ -49,6 +57,7 @@ spec:lib:
-
mysql
spec:services:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
tags
:
...
...
@@ -56,6 +65,7 @@ spec:services:
-
mysql
spec:benchmark:
stage
:
test
script
:
-
RAILS_ENV=test bundle exec rake spec:benchmark
tags
:
...
...
@@ -64,6 +74,7 @@ spec:benchmark:
allow_failure
:
true
spec:other:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
tags
:
...
...
@@ -71,6 +82,7 @@ spec:other:
-
mysql
spinach:project:half:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
tags
:
...
...
@@ -78,6 +90,7 @@ spinach:project:half:
-
mysql
spinach:project:rest:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
tags
:
...
...
@@ -85,6 +98,7 @@ spinach:project:rest:
-
mysql
spinach:other:
stage
:
test
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
tags
:
...
...
@@ -92,6 +106,7 @@ spinach:other:
-
mysql
teaspoon
:
stage
:
test
script
:
-
RAILS_ENV=test bundle exec teaspoon
tags
:
...
...
@@ -99,6 +114,7 @@ teaspoon:
-
mysql
rubocop
:
stage
:
test
script
:
-
bundle exec rubocop
tags
:
...
...
@@ -106,6 +122,7 @@ rubocop:
-
mysql
brakeman
:
stage
:
test
script
:
-
bundle exec rake brakeman
tags
:
...
...
@@ -113,6 +130,7 @@ brakeman:
-
mysql
flog
:
stage
:
test
script
:
-
bundle exec rake flog
tags
:
...
...
@@ -120,6 +138,7 @@ flog:
-
mysql
flay
:
stage
:
test
script
:
-
bundle exec rake flay
tags
:
...
...
@@ -127,6 +146,7 @@ flay:
-
mysql
bundler:audit:
stage
:
test
script
:
-
"
bundle
exec
bundle-audit
update"
-
"
bundle
exec
bundle-audit
check"
...
...
@@ -135,9 +155,10 @@ bundler:audit:
-
mysql
allow_failure
:
true
# Ruby 2.1 jobs
#
#
Ruby 2.1 jobs
spec:ruby21:
stage
:
test
image
:
ruby:2.1
script
:
-
RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
...
...
@@ -149,6 +170,7 @@ spec:ruby21:
-
master
spinach:ruby21:
stage
:
test
image
:
ruby:2.1
script
:
-
RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach
...
...
@@ -157,3 +179,12 @@ spinach:ruby21:
-
mysql
only
:
-
master
notify:slack:
stage
:
notifications
script
:
-
bundle exec rake ci:slack
when
:
on_failure
# only:
# - master
# - tags
\ No newline at end of file
lib/tasks/ci/slack.rake
0 → 100644
View file @
059d8263
namespace
:ci
do
namespace
:slack
do
desc
"GitLab CI | Send slack notification on build failure"
task
error: :environment
do
error_text
=
'Build failed for master/tags'
Kernel
.
system
"curl -X POST --data-urlencode 'payload={
\"
channel
\"
:
\"
#ci-test
\"
,
\"
username
\"
:
\"
gitlab-ci
\"
,
\"
text
\"
:
\"
#{
error_text
}
\"
,
\"
icon_emoji
\"
:
\"
:gitlab:
\"
}' $CI_SLACK_WEBHOOK_URL"
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment