license_finder 5.4.1 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +18 -12
  3. data/Dockerfile +7 -4
  4. data/README.md +15 -14
  5. data/Rakefile +9 -1
  6. data/bin/license_finder +1 -0
  7. data/ci/pipelines/{pipeline.yml.erb → pull-request.yml.erb} +25 -37
  8. data/ci/pipelines/release.yml.erb +199 -0
  9. data/ci/scripts/run-rubocop.sh +1 -1
  10. data/ci/scripts/run-tests.sh +0 -14
  11. data/ci/tasks/run-tests.yml +10 -0
  12. data/dlf +2 -2
  13. data/lib/license_finder.rb +2 -0
  14. data/lib/license_finder/cli.rb +2 -0
  15. data/lib/license_finder/cli/approvals.rb +2 -0
  16. data/lib/license_finder/cli/base.rb +2 -0
  17. data/lib/license_finder/cli/blacklist.rb +2 -0
  18. data/lib/license_finder/cli/dependencies.rb +2 -0
  19. data/lib/license_finder/cli/ignored_dependencies.rb +2 -0
  20. data/lib/license_finder/cli/ignored_groups.rb +2 -0
  21. data/lib/license_finder/cli/licenses.rb +2 -0
  22. data/lib/license_finder/cli/main.rb +3 -0
  23. data/lib/license_finder/cli/makes_decisions.rb +2 -0
  24. data/lib/license_finder/cli/patched_thor.rb +2 -0
  25. data/lib/license_finder/cli/project_name.rb +2 -0
  26. data/lib/license_finder/cli/whitelist.rb +2 -0
  27. data/lib/license_finder/configuration.rb +3 -0
  28. data/lib/license_finder/core.rb +3 -1
  29. data/lib/license_finder/decision_applier.rb +2 -0
  30. data/lib/license_finder/decisions.rb +2 -0
  31. data/lib/license_finder/decisions_factory.rb +2 -0
  32. data/lib/license_finder/diff.rb +5 -3
  33. data/lib/license_finder/license.rb +2 -0
  34. data/lib/license_finder/license/any_matcher.rb +2 -0
  35. data/lib/license_finder/license/definitions.rb +2 -0
  36. data/lib/license_finder/license/header_matcher.rb +2 -0
  37. data/lib/license_finder/license/matcher.rb +2 -0
  38. data/lib/license_finder/license/none_matcher.rb +2 -0
  39. data/lib/license_finder/license/template.rb +2 -0
  40. data/lib/license_finder/license/text.rb +2 -0
  41. data/lib/license_finder/license_aggregator.rb +4 -0
  42. data/lib/license_finder/logger.rb +6 -2
  43. data/lib/license_finder/package.rb +3 -0
  44. data/lib/license_finder/package_delta.rb +3 -1
  45. data/lib/license_finder/package_manager.rb +5 -1
  46. data/lib/license_finder/package_managers/bower.rb +2 -0
  47. data/lib/license_finder/package_managers/bundler.rb +3 -0
  48. data/lib/license_finder/package_managers/cargo.rb +3 -0
  49. data/lib/license_finder/package_managers/carthage.rb +2 -0
  50. data/lib/license_finder/package_managers/cocoa_pods.rb +2 -0
  51. data/lib/license_finder/package_managers/conan.rb +2 -0
  52. data/lib/license_finder/package_managers/dep.rb +2 -0
  53. data/lib/license_finder/package_managers/glide.rb +2 -0
  54. data/lib/license_finder/package_managers/go_15vendorexperiment.rb +4 -0
  55. data/lib/license_finder/package_managers/go_dep.rb +26 -20
  56. data/lib/license_finder/package_managers/go_modules.rb +62 -0
  57. data/lib/license_finder/package_managers/go_workspace.rb +6 -0
  58. data/lib/license_finder/package_managers/govendor.rb +15 -3
  59. data/lib/license_finder/package_managers/gradle.rb +2 -0
  60. data/lib/license_finder/package_managers/gvt.rb +5 -1
  61. data/lib/license_finder/package_managers/maven.rb +2 -0
  62. data/lib/license_finder/package_managers/mix.rb +2 -0
  63. data/lib/license_finder/package_managers/npm.rb +4 -0
  64. data/lib/license_finder/package_managers/nuget.rb +5 -0
  65. data/lib/license_finder/package_managers/pip.rb +4 -1
  66. data/lib/license_finder/package_managers/rebar.rb +2 -0
  67. data/lib/license_finder/package_managers/sbt.rb +2 -0
  68. data/lib/license_finder/package_managers/yarn.rb +6 -2
  69. data/lib/license_finder/package_utils/activation.rb +2 -0
  70. data/lib/license_finder/package_utils/conan_info_parser.rb +3 -0
  71. data/lib/license_finder/package_utils/gradle_dependency_finder.rb +2 -0
  72. data/lib/license_finder/package_utils/license_files.rb +4 -1
  73. data/lib/license_finder/package_utils/licensing.rb +5 -3
  74. data/lib/license_finder/package_utils/maven_dependency_finder.rb +2 -0
  75. data/lib/license_finder/package_utils/possible_license_file.rb +2 -0
  76. data/lib/license_finder/package_utils/sbt_dependency_finder.rb +2 -0
  77. data/lib/license_finder/packages/bower_package.rb +2 -0
  78. data/lib/license_finder/packages/bundler_package.rb +2 -0
  79. data/lib/license_finder/packages/cargo_package.rb +2 -0
  80. data/lib/license_finder/packages/carthage_package.rb +2 -0
  81. data/lib/license_finder/packages/cocoa_pods_package.rb +2 -0
  82. data/lib/license_finder/packages/conan_package.rb +2 -0
  83. data/lib/license_finder/packages/go_package.rb +4 -0
  84. data/lib/license_finder/packages/gradle_package.rb +2 -0
  85. data/lib/license_finder/packages/manual_package.rb +2 -0
  86. data/lib/license_finder/packages/maven_package.rb +2 -0
  87. data/lib/license_finder/packages/merged_package.rb +2 -0
  88. data/lib/license_finder/packages/mix_package.rb +2 -0
  89. data/lib/license_finder/packages/npm_package.rb +5 -0
  90. data/lib/license_finder/packages/nuget_package.rb +2 -0
  91. data/lib/license_finder/packages/pip_package.rb +4 -0
  92. data/lib/license_finder/packages/rebar_package.rb +2 -0
  93. data/lib/license_finder/packages/sbt_package.rb +2 -0
  94. data/lib/license_finder/packages/yarn_package.rb +2 -0
  95. data/lib/license_finder/platform.rb +2 -0
  96. data/lib/license_finder/project_finder.rb +3 -0
  97. data/lib/license_finder/report.rb +2 -0
  98. data/lib/license_finder/scanner.rb +3 -1
  99. data/lib/license_finder/shared_helpers/cmd.rb +2 -0
  100. data/lib/license_finder/shared_helpers/common_path.rb +8 -6
  101. data/lib/license_finder/version.rb +3 -1
  102. data/license_finder.gemspec +5 -2
  103. metadata +21 -5
  104. data/ci/pipelines/release.yml +0 -112
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c2cf5774e9ffa407a6a70a8699c11867121389a3a774240ccc6e52442e25749
4
- data.tar.gz: fd3942b4b46df758837e0d0cf70395291b8767f7c5de24a7e075d4d2214b1dd6
3
+ metadata.gz: 3ef9a16fafb7ca0974987bd5c71facdbd40e832559bd937f94d046f0d7763f01
4
+ data.tar.gz: 426ccea2c910f39b373228481c50734c377b937ffc1f5252af0ced3af7586339
5
5
  SHA512:
6
- metadata.gz: 54602cb06f66e48ca129c9ef1b48ecc859e244016ea5894eb47c4715aaa7e1fedb7e62c3a4d698c5951f2a7c9a41107f5e0d06c685b7098361d59484e63c0188
7
- data.tar.gz: 984ae4ba04df15e38391ff0ba3dd651c8d19c7ee2293793892fcb25db7a3265a703f0dd42318f56f93a8dc295f722e91824f70214a2738471ca73f3eb6e49119
6
+ metadata.gz: 994bbc102f3a889a9a1d899699c961be1ba5c5046bb8a67595fdd55cd75b04c6fdc97c3479d2f342b4ab6a677fc938069d50e9e4cfcfec6599bb00dfb1309e24
7
+ data.tar.gz: 852db8b8336e3b59b2c89981670163ca10098914a68c8cb8ce70805f71f8e74a6a76b65b8cd5d8ac195954a1dd4d63c8592668d071471c65a5c168a5df495d8a
@@ -1,3 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3.3
3
+ Exclude:
4
+ - 'lib/license_finder/reports/**/*'
5
+ - 'features/fixtures/**/*'
6
+ - 'releases/**/*'
7
+ - 'ci/**/*'
8
+ - 'tmp/**/*'
9
+ - 'Gemfile'
10
+
1
11
  #Layout Cops
2
12
  IndentHeredoc:
3
13
  Enabled: false
@@ -32,6 +42,14 @@ YAMLLoad:
32
42
  Enabled: false
33
43
 
34
44
  #Style Cops
45
+ Style/MethodMissingSuper:
46
+ Enabled: false
47
+ Style/MissingRespondToMissing:
48
+ Enabled: false
49
+ Style/FormatStringToken:
50
+ EnforcedStyle: unannotated
51
+ Layout/MultilineMethodCallIndentation:
52
+ Enabled: false
35
53
  DoubleNegation:
36
54
  Enabled: false
37
55
  Documentation:
@@ -41,18 +59,6 @@ FileName:
41
59
  - '**/Rakefile'
42
60
  - '**/Gemfile'
43
61
  - '**/Podfile'
44
- MethodMissing:
45
- Enabled: false
46
62
  ModuleFunction:
47
63
  Enabled: false
48
64
  EnforcedStyle: extend_self
49
- AllCops:
50
- Include:
51
- - 'bin/license_finder'
52
- Exclude:
53
- - 'lib/license_finder/reports/**/*'
54
- - 'features/fixtures/**/*'
55
- - 'releases/**/*'
56
- - 'ci/**/*'
57
- - 'tmp/**/*'
58
- - 'Gemfile'
data/Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM ubuntu:xenial
2
2
 
3
3
  # Versioning
4
4
  ENV PIP_INSTALL_VERSION 10.0.1
5
- ENV GO_LANG_VERSION 1.10.2
5
+ ENV GO_LANG_VERSION 1.11
6
6
  ENV MAVEN_VERSION 3.5.3
7
7
  ENV SBT_VERSION 1.1.1
8
8
  ENV GRADLE_VERSION 4.2
@@ -35,10 +35,10 @@ RUN npm install -g bower && \
35
35
  #install java 8
36
36
  #http://askubuntu.com/questions/521145/how-to-install-oracle-java-on-ubuntu-14-04
37
37
  RUN cd /tmp && \
38
- wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz -O jdk-8.tgz && \
38
+ wget --quiet --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz -O jdk-8.tgz && \
39
39
  tar xf /tmp/jdk-8.tgz && \
40
40
  mkdir -p /usr/lib/jvm && \
41
- mv jdk1.8.0_131 /usr/lib/jvm/oracle_jdk8 && \
41
+ mv jdk1.8.0_181 /usr/lib/jvm/oracle_jdk8 && \
42
42
  rm /tmp/jdk-8.tgz
43
43
 
44
44
  ENV J2SDKDIR=/usr/lib/jvm/oracle_jdk8
@@ -83,7 +83,7 @@ ENV PATH=/root/gradle/bin:$PATH
83
83
 
84
84
  #install go
85
85
  WORKDIR /go
86
- RUN wget https://storage.googleapis.com/golang/go$GO_LANG_VERSION.linux-amd64.tar.gz -O go.tar.gz && tar --strip-components=1 -xf go.tar.gz
86
+ RUN wget https://storage.googleapis.com/golang/go$GO_LANG_VERSION.linux-amd64.tar.gz -O go.tar.gz && tar --strip-components=1 -xf go.tar.gz && rm -f go.tar.gz
87
87
  ENV GOROOT /go
88
88
  ENV PATH=$PATH:/go/bin
89
89
 
@@ -113,6 +113,7 @@ ENV PATH=/usr/local/rvm/bin:$PATH
113
113
  #install mix
114
114
  RUN wget https://packages.erlang-solutions.com/erlang-solutions_${MIX_VERSION}_all.deb && \
115
115
  sudo dpkg -i erlang-solutions_${MIX_VERSION}_all.deb && \
116
+ sudo rm -f erlang-solutions_${MIX_VERSION}_all.deb && \
116
117
  sudo apt-get update && \
117
118
  sudo apt-get install -y esl-erlang && \
118
119
  sudo apt-get install -y elixir
@@ -142,3 +143,5 @@ COPY . /LicenseFinder
142
143
  RUN bash -lc "cd /LicenseFinder && bundle install -j4 && rake install"
143
144
 
144
145
  WORKDIR /
146
+
147
+ CMD cd /scan && /bin/bash -l
data/README.md CHANGED
@@ -3,12 +3,11 @@
3
3
  [![Code Climate](https://codeclimate.com/github/pivotal-legacy/LicenseFinder.png)](https://codeclimate.com/github/pivotal-legacy/LicenseFinder)
4
4
 
5
5
  Build status
6
- * Ruby 2.1.5 [![Ruby 2.1.5 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.1.5/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
7
- * Ruby 2.2.0 [![Ruby 2.2.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.2.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
8
- * Ruby 2.3.0 [![Ruby 2.3.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.3.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
6
+ * Ruby 2.3.7 [![Ruby 2.3.7 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.3.7/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
9
7
  * Ruby 2.4.4 [![Ruby 2.4.4 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.4.4/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
10
8
  * Ruby 2.5.1 [![Ruby 2.5.1 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.5.1/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
11
- * JRuby 9.0.4.0 [![JRuby 9.0.4.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-jruby-9.0.4.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
9
+ * JRuby 9.1.17.0 [![JRuby 9.1.17.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-jruby-9.1.17.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
10
+ * JRuby 9.2.4.0 [![JRuby 9.2.0.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-jruby-9.2.0.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
12
11
 
13
12
 
14
13
  LicenseFinder works with your package managers to find dependencies,
@@ -29,15 +28,15 @@ report.
29
28
 
30
29
  | Project Type | Package Manager | Tested on Version |
31
30
  | ------------ | --------------- | -------:|
32
- | Ruby Gems | bundler | 1.15.4 |
33
- | Python Eggs | pip | 9.0.1 |
34
- | Node.js | npm | 5.3.0 |
35
- | Bower | bower | 1.8.0 |
36
- | Nuget (without license discovery) | nuget | N/A |
37
- | Godep | Godep | 79 |
38
- | Go workspace (via a `.envrc` file) | Go lang | 1.8.3 |
39
- | Go submodules | Go lang | 1.8.3 |
40
- | Java | maven | 3.5.0 |
31
+ | Ruby Gems | bundler | 1.16.6 |
32
+ | Python Eggs | pip | 10.0.1 |
33
+ | Node.js | npm | 6.4.1 |
34
+ | Bower | bower | 1.8.4 |
35
+ | Nuget (without license discovery) | nuget | 4.7.1.5393 |
36
+ | Godep | Godep | 80 |
37
+ | Go workspace (via a `.envrc` file) | Go lang | 1.11 |
38
+ | Go submodules | Go lang | 1.11 |
39
+ | Java | maven | 3.5.3 |
41
40
  | Java | gradle | 4.2 |
42
41
 
43
42
  ### Experimental project types
@@ -51,6 +50,7 @@ report.
51
50
  * C++/C (via `conan`)
52
51
  * Scala (via `sbt`)
53
52
  * Rust (via `cargo`)
53
+ * Go Modules (via `go mod`)
54
54
 
55
55
  ## Installation
56
56
 
@@ -172,6 +172,7 @@ languages, as long as that language has a package definition in the project dire
172
172
  * `glide.lock` file (for `glide`)
173
173
  * `vendor/vendor.json` file (for `govendor`)
174
174
  * `Gopkg.lock` file (for `dep`)
175
+ * `go.sum` file (for `go mod`)
175
176
  * `yarn.lock` file (for `yarn`)
176
177
  * `conanfile.txt` file (for `conan`)
177
178
  * `build.sbt` file (for `sbt`)
@@ -353,7 +354,7 @@ Be default, `license_finder` expects the decisions file to be stored at
353
354
  `doc/dependency_decisions.yml`. All commands can be passed `--decisions_file`
354
355
  to override this location.
355
356
 
356
- ### Of Package Managers
357
+ ### Package Manager Configuration
357
358
 
358
359
  If you have a gradle project, you can invoke gradle with a custom script by
359
360
  passing (for example) `--gradle_command gradlew` to `license_finder` or
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -52,13 +54,19 @@ task :update_pipeline, [:slack_url, :slack_channel] do |_, args|
52
54
  puts 'Warning: You should provide slack channel and url to receive slack notifications on build failures'
53
55
  end
54
56
 
57
+ ruby_versions = %w[2.5.1 2.4.4 2.3.7 jruby-9.1.17.0 jruby-9.2.0.0]
58
+
55
59
  params = []
60
+ params << "ruby_versions=#{ruby_versions.join(',')}"
56
61
  params << "slack_url=#{slack_url}" if slack_url
57
62
  params << "slack_channel=#{slack_channel}" if slack_channel
58
63
 
59
64
  vars = params.join(' ')
60
- cmd = "bash -c \"fly -t osl set-pipeline -n -p LicenseFinder --config <(erb #{vars} ci/pipelines/pipeline.yml.erb)\""
61
65
 
66
+ cmd = "bash -c \"fly -t osl set-pipeline -n -p LicenseFinder --config <(erb #{vars} ci/pipelines/release.yml.erb)\""
67
+ system(cmd)
68
+
69
+ cmd = "bash -c \"fly -t osl set-pipeline -n -p LicenseFinder-pr --config <(erb #{vars} ci/pipelines/pull-request.yml.erb)\""
62
70
  system(cmd)
63
71
  end
64
72
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'license_finder'
4
5
 
@@ -1,11 +1,12 @@
1
1
  <% setup_slack = defined?(slack_url) && defined?(slack_channel) %>
2
- <% ruby_versions = %w(2.5.1 2.4.4 2.3.0 2.2.0 2.1.5 jruby-9.0.4.0) %>
2
+ <% ruby_versions = ruby_versions.split(',') %>
3
3
 
4
4
  resource_types:
5
5
  - name: pull-request
6
6
  type: docker-image
7
7
  source:
8
8
  repository: jtarchie/pr
9
+
9
10
  <% if setup_slack %>
10
11
  - name: slack-notification
11
12
  type: docker-image
@@ -15,11 +16,6 @@ resource_types:
15
16
  <% end %>
16
17
 
17
18
  resources:
18
- - name: LicenseFinder
19
- type: git
20
- source:
21
- uri: https://github.com/pivotal-legacy/LicenseFinder.git
22
- branch: master
23
19
  - name: pull-request
24
20
  type: pull-request
25
21
  source:
@@ -27,6 +23,15 @@ resources:
27
23
  base: master
28
24
  access_token: ((GithubApiPullRequestToken))
29
25
 
26
+ - name: dockerhub-pr
27
+ type: docker-image
28
+ source:
29
+ tag: edge-pr
30
+ repository: licensefinder/license_finder
31
+ email: ((LicenseFinderDockerEmail))
32
+ username: ((LicenseFinderDocker.username))
33
+ password: ((LicenseFinderDocker.password))
34
+
30
35
  <% if setup_slack %>
31
36
  - name: slack-alert
32
37
  type: slack-notification
@@ -35,46 +40,29 @@ resources:
35
40
  <% end %>
36
41
 
37
42
  jobs:
38
- <% ruby_versions.each do |ruby_version| %>
39
- - name: ruby-<%= ruby_version %>
43
+ - name: build-docker-image
40
44
  public: true
41
45
  plan:
42
- - get: LicenseFinder
43
- trigger: true
44
- - task: ruby-<%= ruby_version %>
45
- privileged: true
46
- file: LicenseFinder/ci/tasks/build.yml
47
- params:
48
- RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
49
- <% if setup_slack %>
50
- on_failure:
51
- put: slack-alert
52
- params:
53
- channel: '<%= slack_channel %>'
54
- icon_emoji: ':crying_cat_face:'
55
- text: '<%= "License Finder build failed. Build: https://norsk.cf-app.com/teams/main/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME" %>'
56
- <% end %>
57
- <% end %>
58
-
59
- <% if setup_slack %>
60
- on_failure:
61
- put: slack-alert
62
- params:
63
- channel: '<%= slack_channel %>'
64
- icon_emoji: ':crying_cat_face:'
65
- text: '<%= "License Finder build failed. Build: https://norsk.cf-app.com/teams/main/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME" %>'
66
- <% end %>
67
-
46
+ - get: pull-request
47
+ version: every
48
+ trigger: true
49
+ - put: dockerhub-pr
50
+ params:
51
+ build: pull-request
68
52
  <% ruby_versions.each do |ruby_version| %>
69
53
  - name: PR-ruby-<%= ruby_version %>-linux
70
54
  public: true
71
55
  plan:
72
56
  - get: pull-request
73
- trigger: true
57
+ passed: [build-docker-image]
74
58
  version: every
59
+ - get: dockerhub-pr
60
+ passed: [build-docker-image]
61
+ trigger: true
75
62
  - task: ruby-<%= ruby_version %>
76
63
  privileged: true
77
- file: pull-request/ci/tasks/build.yml
64
+ image: dockerhub-pr
65
+ file: pull-request/ci/tasks/run-tests.yml
78
66
  params:
79
67
  RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
80
68
  input_mapping: { LicenseFinder: pull-request }
@@ -121,4 +109,4 @@ jobs:
121
109
  params:
122
110
  path: pull-request
123
111
  status: failure
124
- context: run-rubocop
112
+ context: run-rubocop
@@ -0,0 +1,199 @@
1
+ <% setup_slack = defined?(slack_url) && defined?(slack_channel) %>
2
+ <% ruby_versions = ruby_versions.split(',') %>
3
+
4
+ resource_types:
5
+ <% if setup_slack %>
6
+ - name: slack-notification
7
+ type: docker-image
8
+ source:
9
+ repository: cfcommunity/slack-notification-resource
10
+ tag: latest
11
+ <% end %>
12
+
13
+ resources:
14
+ - name: git-master
15
+ type: git
16
+ source:
17
+ uri: git@github.com:pivotal-legacy/LicenseFinder.git
18
+ private_key: ((CfOslBot.private_key))
19
+ branch: master
20
+
21
+ - name: git-master-dockerfile
22
+ type: git
23
+ source:
24
+ uri: git@github.com:pivotal-legacy/LicenseFinder.git
25
+ private_key: ((CfOslBot.private_key))
26
+ branch: master
27
+ paths: [Dockerfile]
28
+
29
+ - name: dockerhub-edge
30
+ type: docker-image
31
+ source:
32
+ tag: edge
33
+ repository: licensefinder/license_finder
34
+ email: ((LicenseFinderDockerEmail))
35
+ username: ((LicenseFinderDocker.username))
36
+ password: ((LicenseFinderDocker.password))
37
+
38
+ - name: dockerhub
39
+ type: docker-image
40
+ source:
41
+ repository: licensefinder/license_finder
42
+ email: ((LicenseFinderDockerEmail))
43
+ username: ((LicenseFinderDocker.username))
44
+ password: ((LicenseFinderDocker.password))
45
+
46
+ - name: git-release
47
+ type: github-release
48
+ source:
49
+ owner: pivotal
50
+ repository: LicenseFinder
51
+ access_token: ((GithubApiRootToken))
52
+
53
+ <% if setup_slack %>
54
+ - name: slack-alert
55
+ type: slack-notification
56
+ source:
57
+ url: <%= slack_url %>
58
+ <% end %>
59
+
60
+ jobs:
61
+
62
+ - name: patch-version
63
+ plan:
64
+ - get: git-master
65
+ passed: [<%= ruby_versions.map{ |version| "ruby-#{version}"}.join(', ') %>]
66
+ - get: dockerhub
67
+ params:
68
+ save: true
69
+ - task: bump-version
70
+ params:
71
+ image: docker-image
72
+ GIT_USERNAME: ((GithubApiUser))
73
+ GIT_EMAIL: ((GithubApiEmail))
74
+ file: git-master/ci/tasks/bump-patch-version.yml
75
+ - put: git-master
76
+ params:
77
+ repository: git-master-changed
78
+
79
+ - name: release
80
+ plan:
81
+ - get: git-master
82
+ trigger: true
83
+ passed: [ patch-version ]
84
+ - get: dockerhub
85
+ params:
86
+ save: true
87
+ - get: git-release
88
+ - task: update-changelog
89
+ image: docker-image
90
+ params:
91
+ GIT_USERNAME: ((GithubApiUser))
92
+ GIT_EMAIL: ((GithubApiEmail))
93
+ file: git-master/ci/tasks/update-changelog.yml
94
+ - put: dockerhub
95
+ params:
96
+ build: git-master
97
+ tag: version/version.txt
98
+ tag_as_latest: true
99
+ - put: git-master
100
+ params:
101
+ repository: git-master-changed
102
+ - task: build-and-push-gem
103
+ image: docker-image
104
+ params:
105
+ GIT_USERNAME: ((GithubApiUser))
106
+ GIT_EMAIL: ((GithubApiEmail))
107
+ GIT_PRIVATE_KEY: ((CfOslBot.private_key))
108
+ GEM_API_KEY: ((LicenseFinderGemApiKey))
109
+ file: git-master/ci/tasks/build-and-push-gem.yml
110
+ - put: git-release
111
+ params:
112
+ name: version/tag.txt
113
+ tag: version/tag.txt
114
+ body: version/changelog.txt
115
+
116
+ - name: manual-release
117
+ plan:
118
+ - get: git-master
119
+ passed: [<%= ruby_versions.map{ |version| "ruby-#{version}"}.join(', ') %>]
120
+ - get: dockerhub
121
+ params:
122
+ save: true
123
+ - get: git-release
124
+ - task: update-changelog
125
+ image: docker-image
126
+ params:
127
+ GIT_USERNAME: ((GithubApiUser))
128
+ GIT_EMAIL: ((GithubApiEmail))
129
+ file: git-master/ci/tasks/update-changelog.yml
130
+ - put: dockerhub
131
+ params:
132
+ build: git-master
133
+ tag_file: version/version.txt
134
+ tag_as_latest: true
135
+ - task: build-and-push-gem
136
+ image: docker-image
137
+ params:
138
+ GIT_USERNAME: ((GithubApiUser))
139
+ GIT_EMAIL: ((GithubApiEmail))
140
+ GIT_PRIVATE_KEY: ((CfOslBot.private_key))
141
+ GEM_API_KEY: ((LicenseFinderGemApiKey))
142
+ file: git-master/ci/tasks/build-and-push-gem.yml
143
+ - put: git-master
144
+ params:
145
+ repository: git-master-changed
146
+ - put: git-release
147
+ params:
148
+ name: version/tag.txt
149
+ tag: version/tag.txt
150
+ body: version/changelog.txt
151
+ - name: build-docker-image
152
+ public: true
153
+ plan:
154
+ - get: git-master-dockerfile
155
+ trigger: true
156
+ - put: dockerhub-edge
157
+ params:
158
+ build: git-master-dockerfile
159
+ <% ruby_versions.each do |ruby_version| %>
160
+ - name: ruby-<%= ruby_version %>
161
+ public: true
162
+ plan:
163
+ - get: dockerhub-edge
164
+ passed: [build-docker-image]
165
+ trigger: true
166
+ - get: LicenseFinder
167
+ resource: git-master
168
+ trigger: true
169
+ version: every
170
+ - task: ruby-<%= ruby_version %>
171
+ privileged: true
172
+ image: dockerhub-edge
173
+ file: LicenseFinder/ci/tasks/run-tests.yml
174
+ params:
175
+ RUBY_VERSION_UNDER_TEST: <%= ruby_version %>
176
+ <% if setup_slack %>
177
+ on_failure:
178
+ put: slack-alert
179
+ params:
180
+ channel: '<%= slack_channel %>'
181
+ icon_emoji: ':crying_cat_face:'
182
+ text: '<%= "License Finder build failed. Build: https://norsk.cf-app.com/teams/main/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME" %>'
183
+ <% end %>
184
+ <% end %>
185
+
186
+ - name: rubocop
187
+ public: true
188
+ plan:
189
+ - get: dockerhub-edge
190
+ passed: [build-docker-image]
191
+ trigger: true
192
+ - get: LicenseFinder
193
+ resource: git-master
194
+ trigger: true
195
+ version: every
196
+ - task: run-rubocop
197
+ privileged: true
198
+ file: LicenseFinder/ci/tasks/rubocop.yml
199
+ input_mapping: { LicenseFinder: LicenseFinder }