fastlane-plugin-semaphore 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +57 -0
- data/lib/fastlane/plugin/semaphore.rb +16 -0
- data/lib/fastlane/plugin/semaphore/actions/setup_semaphore_action.rb +106 -0
- data/lib/fastlane/plugin/semaphore/helper/semaphore_helper.rb +17 -0
- data/lib/fastlane/plugin/semaphore/version.rb +5 -0
- metadata +175 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 298c5b53e7e562075e0d3b2d33377da569bab0a8aa2a3f7eeff1c683295aafcf
|
4
|
+
data.tar.gz: ad517ba03779abedbca7b5d5c772590a98a3259ce12d296650009576b3fad555
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1bb75f88eaf031044472c9bb319d4bc18b489a8ca2d5946e3e43b1bff52df184f7a2dd94f3b722a01b894ad7a8b1018d35cde9931d417b42ed9bdb6958e2cd3e
|
7
|
+
data.tar.gz: ff270b389184153320d689844ceaa4577369ffdc9cacd3ade18dbf545be777fc56208c1915160c8c5a16e50879256db54e305f4c8f393c3043e47ea4fe5a6fbe
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Rendered Text.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# semaphore plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-semaphore)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-semaphore`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin semaphore
|
11
|
+
```
|
12
|
+
|
13
|
+
## About semaphore
|
14
|
+
|
15
|
+
Semaphore CI is available at <https://semaphoreci.com/>
|
16
|
+
|
17
|
+
This plugin adds `setup_semaphore`. The action:
|
18
|
+
|
19
|
+
* Starts if in CI or `force` parameter is set to `true`
|
20
|
+
* Creates a temporary keychain if the `MATCH_KEYCHAIN_NAME` envrionment was not set (i.e. if keychain is not created yet)
|
21
|
+
* Puts `match` in readonly mode to not modify certificates on CI
|
22
|
+
* If `FL_OUTPUT_DIR` environment variable is set, then `scan`, `gym` and build logs will be set in subdirectories of that path.
|
23
|
+
|
24
|
+
## Example
|
25
|
+
|
26
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
27
|
+
|
28
|
+
See example project at https://github.com/semaphoreci-demos/semaphore-demo-ios-swift-xcode
|
29
|
+
|
30
|
+
## Run tests for this plugin
|
31
|
+
|
32
|
+
To run both the tests, and code style validation, run
|
33
|
+
|
34
|
+
```
|
35
|
+
rake
|
36
|
+
```
|
37
|
+
|
38
|
+
To automatically fix many of the styling issues, use
|
39
|
+
```
|
40
|
+
rubocop -a
|
41
|
+
```
|
42
|
+
|
43
|
+
## Issues and Feedback
|
44
|
+
|
45
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
46
|
+
|
47
|
+
## Troubleshooting
|
48
|
+
|
49
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
50
|
+
|
51
|
+
## Using _fastlane_ Plugins
|
52
|
+
|
53
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
54
|
+
|
55
|
+
## About _fastlane_
|
56
|
+
|
57
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/semaphore/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Semaphore
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Semaphore.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/semaphore_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class SetupSemaphoreAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
unless Helper.ci? || params[:force]
|
9
|
+
UI.message("Not running on CI, skipping `#{action_name}`.")
|
10
|
+
return
|
11
|
+
end
|
12
|
+
set_temp_keychain
|
13
|
+
set_readonly_mode
|
14
|
+
set_output_paths
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.set_temp_keychain
|
18
|
+
unless ENV["MATCH_KEYCHAIN_NAME"].nil?
|
19
|
+
UI.message("Skipping Keychain setup as a keychain was already specified")
|
20
|
+
return
|
21
|
+
end
|
22
|
+
keychain_name = default_keychain_name
|
23
|
+
ENV["MATCH_KEYCHAIN_NAME"] = keychain_name
|
24
|
+
ENV["MATCH_KEYCHAIN_PASSWORD"] = ""
|
25
|
+
|
26
|
+
UI.message("Creating temporary keychain: \"#{keychain_name}\".")
|
27
|
+
Actions::CreateKeychainAction.run(
|
28
|
+
name: keychain_name,
|
29
|
+
default_keychain: true,
|
30
|
+
unlock: true,
|
31
|
+
timeout: false,
|
32
|
+
lock_when_sleeps: true,
|
33
|
+
add_to_search_list: true,
|
34
|
+
password: ""
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.set_readonly_mode
|
39
|
+
UI.message("Enabling match readonly mode.")
|
40
|
+
ENV["MATCH_READONLY"] = true.to_s
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.set_output_paths
|
44
|
+
unless ENV["FL_OUTPUT_DIR"]
|
45
|
+
UI.message("Skipping Log Path setup as FL_OUTPUT_DIR is unset")
|
46
|
+
return
|
47
|
+
end
|
48
|
+
|
49
|
+
root = Pathname.new(ENV["FL_OUTPUT_DIR"])
|
50
|
+
ENV["SCAN_OUTPUT_DIRECTORY"] = (root + "scan").to_s
|
51
|
+
ENV["GYM_OUTPUT_DIRECTORY"] = (root + "gym").to_s
|
52
|
+
ENV["FL_BUILDLOG_PATH"] = (root + "buildlogs").to_s
|
53
|
+
ENV["SCAN_INCLUDE_SIMULATOR_LOGS"] = true.to_s
|
54
|
+
|
55
|
+
UI.message("Log paths set up to #{ENV["FL_OUTPUT_DIR"]}")
|
56
|
+
UI.message("\tscan logs: #{ENV["SCAN_OUTPUT_DIRECTORY"]}")
|
57
|
+
UI.message("\tgym logs: #{ENV["GYM_OUTPUT_DIRECTORY"]}")
|
58
|
+
UI.message("\tbuild logs: #{ENV["FL_BUILDLOG_PATH"]}")
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.description
|
62
|
+
"Semaphore CI integration"
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.authors
|
66
|
+
["Dmitry Bespalov"]
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.action_name
|
70
|
+
"setup_semaphore"
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.default_keychain_name
|
74
|
+
"semaphore_temporary_keychain"
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.return_value
|
78
|
+
# If your method provides a return value, you can describe here what it does
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.details
|
82
|
+
# Optional:
|
83
|
+
"This plugin provides actions for setiing up Semaphore CI environment"
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.available_options
|
87
|
+
[
|
88
|
+
FastlaneCore::ConfigItem.new(key: :force,
|
89
|
+
env_name: "SEMAPHORE_CI_FORCE",
|
90
|
+
description: "Force setup, even if not executed by Semaphore CI",
|
91
|
+
optional: true,
|
92
|
+
default_value: false,
|
93
|
+
type: Boolean)
|
94
|
+
]
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.is_supported?(platform)
|
98
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
99
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
100
|
+
#
|
101
|
+
# [:ios, :mac, :android].include?(platform)
|
102
|
+
[:ios].include?(platform)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
5
|
+
|
6
|
+
module Helper
|
7
|
+
class SemaphoreHelper
|
8
|
+
# class methods that you define here become available in your action
|
9
|
+
# as `Helper::SemaphoreHelper.your_method`
|
10
|
+
#
|
11
|
+
# Example:
|
12
|
+
# def self.show_message
|
13
|
+
# UI.message("Hello from the semaphore plugin helper!")
|
14
|
+
# end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-semaphore
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dmitry Bespalov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-require_tools
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fastlane
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.120.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.120.0
|
139
|
+
description:
|
140
|
+
email: dmitry.bespalov@gnosis.pm
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- LICENSE
|
146
|
+
- README.md
|
147
|
+
- lib/fastlane/plugin/semaphore.rb
|
148
|
+
- lib/fastlane/plugin/semaphore/actions/setup_semaphore_action.rb
|
149
|
+
- lib/fastlane/plugin/semaphore/helper/semaphore_helper.rb
|
150
|
+
- lib/fastlane/plugin/semaphore/version.rb
|
151
|
+
homepage: https://github.com/semaphoreci/fastlane-plugin-semaphore
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.7.3
|
172
|
+
signing_key:
|
173
|
+
specification_version: 4
|
174
|
+
summary: Semaphore CI integration
|
175
|
+
test_files: []
|