mcrain 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7d18a6937f4e154940146b53cfc657da38171ae8
4
- data.tar.gz: 99137cb4d00e234344ec07d7a416c53e8bffbc72
2
+ SHA256:
3
+ metadata.gz: '04783d681050f6504a841bf70d8632bb2d05436b6b299cc8cf238766b109d04a'
4
+ data.tar.gz: 8221085a9015fafc8310165ca968d4c387d991c4c99b7802c6d87bf42107e1d6
5
5
  SHA512:
6
- metadata.gz: 751aca2467b0b5f0745365d794a59680cb44496a0d45acee57271ed8a2f5e65dba1be45ea5e882b253d070efc238d4509bdb9b3d614681e5ce2bca64b3270892
7
- data.tar.gz: 75b30cc1936edad4252ee829a1ac9d5f619c922f00e092da5b9bb78ae0f69b864e56ed157779a6545c689a233d18cffcbf724f83f821cd7b9c3f418538a67fb4
6
+ metadata.gz: 8993fb3864e5122ea81f8d74457b643187b0c7ca4f11b37ca477b7c0e4b145d5fc3e9148e6c33cdba41eac03649d607067eeafb93e745a15ad6e68a3642ea05c
7
+ data.tar.gz: 130dd59bdda40ada03089e50dd85054318c440d4651ea2d50a913a53153b33326ad73ffdd23d58c057623cbb4003640e51fa668b7beb584f414a343aa6d7f2f6
@@ -4,7 +4,8 @@ jobs:
4
4
  working_directory: ~/mcrain
5
5
 
6
6
  ## see https://circleci.com/docs/2.0/executor-types/#machine-executor-overview
7
- machine: true
7
+ machine:
8
+ image: circleci/classic:201711-01
8
9
 
9
10
  steps:
10
11
  - checkout
@@ -27,6 +28,12 @@ jobs:
27
28
  gem env
28
29
  bundle --version
29
30
 
31
+ - run:
32
+ name: Install dependencies
33
+ command: |
34
+ sudo apt-get update
35
+ sudo apt-get install -y --no-install-recommends libmysqlclient-dev
36
+
30
37
  - run:
31
38
  name: Open docker TCP port
32
39
  command: |
@@ -0,0 +1,58 @@
1
+ pipeline {
2
+ agent any
3
+ stages {
4
+ stage("test") {
5
+ agent { label "unittest" }
6
+ environment {
7
+ PARALLEL_TEST_PROCESSORS = "1"
8
+ BUNDLE_DISABLE_EXEC_LOAD = "1"
9
+ DOCKER_HOST = "tcp://127.0.0.1:2375"
10
+ }
11
+ steps {
12
+ sh '''#!/bin/bash -l
13
+ set -xe
14
+ export -p
15
+ gem env
16
+ bundle check || bundle install --jobs=4 --path=vendor/bundle
17
+ bundle exec mcrain pull all
18
+ bundle exec rake parallel:spec
19
+ '''
20
+ }
21
+ }
22
+ }
23
+ post {
24
+ changed {
25
+ slackNotify(currentBuild.currentResult)
26
+ }
27
+ aborted {
28
+ slackNotify("ABORTED")
29
+ }
30
+ }
31
+ }
32
+
33
+
34
+ def slackNotify(result){
35
+ // https://github.com/jenkinsci/slack-plugin/issues/327
36
+ def durationString = currentBuild.durationString.replace(' and counting', '')
37
+ def notificationMessage = {resultString ->
38
+ "${env.JOB_NAME} - ${currentBuild.displayName} ${resultString} after ${durationString} (<${env.RUN_DISPLAY_URL}|Open>)"
39
+ }
40
+ switch(result){
41
+ case "SUCCESS":
42
+ slackSend color: 'good', message: notificationMessage("Back to normal")
43
+ break
44
+ case "FAILURE":
45
+ slackSend color: 'danger', message: notificationMessage("Failure")
46
+ break
47
+ case "UNSTABLE":
48
+ slackSend color: 'danger', message: notificationMessage("Unstable")
49
+ break
50
+ case "ABORTED":
51
+ slackSend color: 'warning', message: notificationMessage("Aborted")
52
+ break
53
+ default:
54
+ slackSend color: 'warning', message: notificationMessage("Unknown")
55
+ }
56
+ }
57
+
58
+ /* vim:set ft=groovy: */
data/exe/mcrain CHANGED
@@ -92,7 +92,7 @@ begin
92
92
 
93
93
  rescue => e
94
94
  $stderr.puts "\e[31m[#{e.class}] #{e.message}\e[0m"
95
- $stderr.puts e.backtrace.join("\n ") if verbose
95
+ $stderr.puts e.backtrace.join("\n ") if opts[:verbose]
96
96
  exit(1)
97
97
  else
98
98
  $stderr.puts "\e[32mOK\e[0m"
@@ -1,3 +1,3 @@
1
1
  module Mcrain
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-20 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger_pipe
@@ -109,6 +109,7 @@ files:
109
109
  - ".travis.yml"
110
110
  - CODE_OF_CONDUCT.md
111
111
  - Gemfile
112
+ - Jenkinsfile
112
113
  - README.md
113
114
  - Rakefile
114
115
  - bin/console
@@ -147,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  version: '0'
148
149
  requirements: []
149
150
  rubyforge_project:
150
- rubygems_version: 2.5.2.1
151
+ rubygems_version: 2.7.6
151
152
  signing_key:
152
153
  specification_version: 4
153
154
  summary: mcrain supports to run docker container for test.