samus 3.0.8 → 3.0.9

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
2
  SHA256:
3
- metadata.gz: 47279c933b0dab9bdb56c9ef345f2d9330169b479a79b03c098d13c1164d5a28
4
- data.tar.gz: 1edb84d24b1f00f5383d67e46a58f8c7fd39e72ff82358ba192b19a340343427
3
+ metadata.gz: f04e142129687658a7fd111af0ed1587d9e6d6c2b5d7d5c8b6eaab195940dfa9
4
+ data.tar.gz: a53a88046167502a858b185831d20217a4542c19a6305b618f9467093231bed6
5
5
  SHA512:
6
- metadata.gz: 6f135fdb15cf918f35ac84f9dfdb4535a2c60dfdae2512f83b820fbfb61dd259b2033507259e14615371f1081a4ae46fbf542a244688baa51acc17832f2a60ec
7
- data.tar.gz: 1accade2c2eb7adadb4599663d1a28f96db8e29c7af61e16f18df43e5e1c0e106ad10aa97207b2431469990a3af882988ec1184fd41d8e49ebbfde93659ed8e0
6
+ metadata.gz: 8613ffe3e5f6106b92c15a527854f1b0e21f0f6c0aba4358a5e77214a169768e75ba7c7be8f80b501a06e28eb7ba29cc822f63ffe89aec378e48982b16af2f70
7
+ data.tar.gz: b2dbfc18ff675b399cc4e781a62ab461e32669f08a2fb1924a742aa1a7c1289c4d48f82ee1eaefe05d6cfeeffed88ccc4de9e2cc18fd888c02108bfe18e3f7cb
@@ -1,4 +1,10 @@
1
- # master
1
+ # main
2
+
3
+ # 3.0.9 - June 19th, 2020
4
+
5
+ [3.0.9]: https://github.com/lsegal/samus/compare/v3.0.8...v3.0.9
6
+
7
+ - Improved support for alternate primary branch names
2
8
 
3
9
  # 3.0.8 - April 1st, 2019
4
10
 
data/Dockerfile CHANGED
@@ -2,8 +2,8 @@ FROM python:3.7-alpine
2
2
 
3
3
  RUN apk add -U --no-cache openssh ruby ruby-json nodejs git curl
4
4
  RUN pip install awscli
5
- RUN gem install bundler -v '1.17.3' --no-rdoc --no-ri
6
- RUN gem install rake --no-rdoc --no-ri
5
+ RUN gem install bundler --no-document
6
+ RUN gem install rake --no-document
7
7
  RUN mkdir -p ~/.ssh
8
8
  RUN echo "Host *" > ~/.ssh/config
9
9
  RUN echo " StrictHostKeyChecking no" >> ~/.ssh/config
@@ -13,6 +13,7 @@ RUN git config --global user.email "bot@not.human"
13
13
  RUN git config --global user.name "Samus Release Bot"
14
14
 
15
15
  COPY . /samus
16
+ RUN chmod 755 /samus/commands/build/* /samus/commands/publish/*
16
17
  ENV PATH=$PATH:/samus/bin
17
18
 
18
19
  WORKDIR /build
data/README.md CHANGED
@@ -18,7 +18,7 @@ machine.
18
18
  Samus is a RubyGem and requires Ruby 1.9.x+. Installing is as easy as typing:
19
19
 
20
20
  ```sh
21
- $ gem install samus
21
+ gem install samus
22
22
  ```
23
23
 
24
24
  If you would rather use Samus via Docker, see the Docker section in Usage below.
@@ -44,7 +44,7 @@ manifest file is just a list of discrete actions like so (minus comments):
44
44
  "action": "git-push",
45
45
  "arguments": {
46
46
  "remotes": "origin",
47
- "refs": "master v1.5.0" // the v1.5.0 is a tag for your release
47
+ "refs": "main v1.5.0" // the v1.5.0 is a tag for your release
48
48
  }
49
49
  },
50
50
  {
@@ -91,9 +91,9 @@ it "samus.json" for easier integration:
91
91
  "files": ["lib/my-gem/version.rb"]
92
92
  },
93
93
  {
94
- "action": "git-merge", // merge new commit into master branch
94
+ "action": "git-merge", // merge new commit into main branch
95
95
  "arguments": {
96
- "branch": "master"
96
+ "branch": "main"
97
97
  }
98
98
  },
99
99
  {
@@ -103,7 +103,7 @@ it "samus.json" for easier integration:
103
103
  "action": "git-push",
104
104
  "arguments": {
105
105
  "remotes": "origin",
106
- "refs": "master v$version"
106
+ "refs": "main v$version"
107
107
  }
108
108
  }]
109
109
  },
@@ -123,12 +123,12 @@ it "samus.json" for easier integration:
123
123
  ```
124
124
 
125
125
  It looks a little longer, but it contains all of the steps to automate when
126
- bumping the VERSION constant, tagging a version, merging into the master
126
+ bumping the VERSION constant, tagging a version, merging into the primary
127
127
  branch, and building the gem. To build a release with this manifest, simply
128
128
  type:
129
129
 
130
130
  ```sh
131
- $ samus build 1.5.0
131
+ samus build 1.5.0
132
132
  ```
133
133
 
134
134
  Samus will look for `samus.json` and build a release for version 1.5.0 of your
@@ -136,10 +136,10 @@ code. It will produce an archive called `release-v1.5.0.tar.gz` that you
136
136
  can then publish with:
137
137
 
138
138
  ```sh
139
- $ samus publish release-v1.5.0.tar.gz
139
+ samus publish release-v1.5.0.tar.gz
140
140
  ```
141
141
 
142
- You may have noticed some funny looking "$version" strings in the above
142
+ You may have noticed some funny looking "\$version" strings in the above
143
143
  manifest. Those strings will be replaced with the version provided in the
144
144
  build command, so all the correct tagging and building will be handled for you.
145
145
 
@@ -227,14 +227,14 @@ repositories. In this case, you can simply type `samus install REPO` to
227
227
  download the repository to your machine:
228
228
 
229
229
  ```sh
230
- $ samus install git@github.com:my_org/samus_config
230
+ samus install git@github.com:my_org/samus_config
231
231
  ```
232
232
 
233
233
  Of course, Samus doesn't need these custom packages to be Git-backed. All
234
234
  the above command does is clone a repository into the ~/.samus directory.
235
235
  The above command creates:
236
236
 
237
- ```
237
+ ```plaintext
238
238
  .samus/
239
239
  `- samus_config/
240
240
  `- commands/
@@ -274,18 +274,20 @@ commands directory depending on whether they are for `samus build` or
274
274
  In addition to exposing arguments as underscored environment variables,
275
275
  Samus also exposes a few special variables with double underscore prefixes:
276
276
 
277
- - `__build_dir` - this variable refers to the temporary directory that the
277
+ - `__BUILD_DIR` - this variable refers to the temporary directory that the
278
278
  release package is being built inside of. The files inside of this directory,
279
279
  and _only_ the files inside of this directory, will be built into the release
280
280
  archive. If you write a build-time command that produces an output file which
281
281
  is part of the release, you should make sure to move it into this directory.
282
- - `__restore_file` - the restore file is a newline delimited file containing
282
+ - `__ORIG_BRANCH` - the original branch being built from.
283
+ - `__BUILD_BRANCH` - the name of the branch being built to.
284
+ - `__RESTORE_FILE` - the restore file is a newline delimited file containing
283
285
  branches and their original ref. All branches listed in this file will be
284
286
  restored to the respective ref at the end of `samus build` regardless of
285
287
  success status. If you make destructive modifications to existing branches
286
288
  in the workspace repository, you should add the original ref for the branch
287
289
  to this file.
288
- - `__creds_*` - provides key, secret, and other values loaded from credentials.
290
+ - `__CREDS_*` - provides key, secret, and other values loaded from credentials.
289
291
  See Credentials section for more information on how these are set.
290
292
 
291
293
  #### Help Files
@@ -295,14 +297,15 @@ command should include a file named `your-command.help.md` in the same directory
295
297
  as the command script itself. These files are Markdown-formatted files and
296
298
  should follow the same structure of the built-in command help files:
297
299
 
298
- ```
300
+ ```markdown
299
301
  Short description of command.
300
302
 
301
- * Files:
302
- * Description of what the command line arguments are
303
+ - Files:
304
+
305
+ - Description of what the command line arguments are
303
306
 
304
- * Arguments:
305
- * argname: Documentation for argument
307
+ - Arguments:
308
+ - argname: Documentation for argument
306
309
  ```
307
310
 
308
311
  Notes:
@@ -425,7 +428,7 @@ property:
425
428
 
426
429
  The "condition" property is a Ruby expression that is evaluated for truthiness
427
430
  to decide if the action item should be evaluated or skipped. A common use for
428
- this is to take action based on the version (see "$version" variable section
431
+ this is to take action based on the version (see "\$version" variable section
429
432
  below). The following example runs an action item only for version 2.0+ of a
430
433
  release:
431
434
 
@@ -437,9 +440,9 @@ release:
437
440
  }
438
441
  ```
439
442
 
440
- #### "$version" Variable
443
+ #### "\$version" Variable
441
444
 
442
- A special variable "$version" is interpolated when loading the build manifest.
445
+ A special variable "\$version" is interpolated when loading the build manifest.
443
446
  This variable can appear anywhere in the JSON document, and is interpolated
444
447
  before any actions or conditions are evaluated.
445
448
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  file = ARGV[0]
4
4
  ver = ENV['_VERSION']
5
- master = ENV['_MASTER'] || 'master'
5
+ heading = ENV['_HEADING'] || ENV['_MASTER'] || ENV['__ORIG_BRANCH']
6
6
  title_fmt = ENV['_TITLE_FORMAT'] || "[$version] - %B %-d$day_nth, %Y"
7
7
  ENV['TZ'] ||= ENV['_TZ']
8
8
 
@@ -11,11 +11,11 @@ compare_url = `git config remote.origin.url`.strip.sub(/^git@(.+?):/, 'https://\
11
11
  day_nth = {1 => 'st', 2 => 'nd', 3 => 'rd'}[Time.now.day % 10] || 'th'
12
12
  title = Time.now.strftime(title_fmt).sub('$version', ver).sub('$day_nth', day_nth)
13
13
 
14
- match = /\A\s*# #{master}\r?\n(?<body>.*?)(?<rest>\r?\n# .+|\Z)/mis.match(content)
15
- raise "Failed to rotate changelog: #{file}" unless match
14
+ match = /\A\s*# #{heading}\r?\n(?<body>.*?)(?<rest>\r?\n# .+|\Z)/mis.match(content)
15
+ raise "Failed to rotate changelog: #{file} (invalid heading: #{heading})" unless match
16
16
 
17
17
  prev_ver = match['rest'][/(\d+\.\d+(?:\.\d+)?)/, 1]
18
- repl = "# #{master}\n\n# #{title}\n\n" +
18
+ repl = "# #{heading}\n\n# #{title}\n\n" +
19
19
  (prev_ver ? "[#{ver}]: #{compare_url}/compare/v#{prev_ver}...v#{ver}\n" : '') +
20
20
  match['body'] + match['rest']
21
21
  File.open(file, 'w') {|f| f.write(repl) }
@@ -8,7 +8,7 @@ Files:
8
8
 
9
9
  Arguments:
10
10
 
11
- - master: (optional) defaults to "master", should match the first development
11
+ - heading: (optional) defaults to primary branch name, should match the first development
12
12
  heading used for in-flux changelog entries before rotation.
13
13
  - title_format: (optional) a `Time.strftime` date formatted string that can
14
14
  also include `$version` to represent the title of the rotated changelog entry.
@@ -1,8 +1,20 @@
1
1
  #!/bin/sh
2
2
 
3
3
  set -e
4
- git clone -q --branch ${_BRANCH-master} \
4
+
5
+ cd ${_REPOSITORY-.}
6
+ BRANCHES=`git branch --list --format="%(refname:lstrip=2)"`
7
+
8
+ git clone -q $([ -n "$_BRANCH" ] && echo --branch $_BRANCH) \
5
9
  ${_REPOSITORY-.} $__BUILD_DIR/$1 2>${__DEVNULL-/dev/null}
6
10
 
11
+ oldpw=`pwd`
12
+ cd $__BUILD_DIR/$1
13
+ for branch in $BRANCHES; do
14
+ echo Copying over $branch from repository.
15
+ git branch $branch --track origin/$branch 2>${__DEVNULL-/dev/null} || true
16
+ done
17
+ cd $oldpw
18
+
7
19
  # preserve all previously configured remotes for publish actions
8
20
  cp ${_REPOSITORY-.}/.git/config $__BUILD_DIR/$1/.git/config
@@ -5,4 +5,4 @@ Files:
5
5
 
6
6
  Arguments:
7
7
  * repository: the location of the working copy repository, defaults to ".".
8
- * branch: the branch to clone, defaults to "master"
8
+ * branch: the branch to clone, clones to default primary if not provided.
@@ -43,6 +43,7 @@ module Samus
43
43
  '_RESTORE_FILE' => RESTORE_FILE,
44
44
  '_BUILD_DIR' => build_dir,
45
45
  '_BUILD_BRANCH' => build_branch,
46
+ '_ORIG_BRANCH' => orig_branch,
46
47
  '_DEVNULL' => devnull,
47
48
  'VERSION' => version
48
49
  }).load(action)
@@ -1,3 +1,3 @@
1
1
  module Samus
2
- VERSION = '3.0.8'.freeze
2
+ VERSION = '3.0.9'.freeze
3
3
  end
data/samus.json CHANGED
@@ -2,7 +2,9 @@
2
2
  "actions": [
3
3
  {
4
4
  "action": "fs-sedfiles",
5
- "files": ["lib/*/version.rb"],
5
+ "files": [
6
+ "lib/*/version.rb"
7
+ ],
6
8
  "arguments": {
7
9
  "search": "VERSION = ['\"](.+?)['\"]",
8
10
  "replace": "VERSION = '$version'"
@@ -10,7 +12,9 @@
10
12
  },
11
13
  {
12
14
  "action": "changelog-rotate",
13
- "files": ["CHANGELOG.md"],
15
+ "files": [
16
+ "CHANGELOG.md"
17
+ ],
14
18
  "arguments": {
15
19
  "title_format": "$version - %B %-d$day_nth, %Y",
16
20
  "tz": "GMT+8"
@@ -27,42 +31,53 @@
27
31
  },
28
32
  {
29
33
  "action": "git-commit",
30
- "files": ["CHANGELOG.md", "lib/*/version.rb"]
34
+ "files": [
35
+ "CHANGELOG.md",
36
+ "lib/*/version.rb"
37
+ ]
31
38
  },
32
39
  {
33
40
  "action": "git-merge",
34
41
  "arguments": {
35
- "branch": "master"
42
+ "branch": "main"
36
43
  }
37
44
  },
38
45
  {
39
46
  "action": "git-clone",
40
- "files": ["git-repo"],
47
+ "files": [
48
+ "git-repo"
49
+ ],
41
50
  "publish": [
42
51
  {
43
52
  "action": "git-push",
44
53
  "credentials": "lsegal.github.ssh",
45
54
  "arguments": {
46
55
  "remotes": "origin",
47
- "refs": "master v$version"
56
+ "refs": "main v$version"
48
57
  }
49
58
  }
50
59
  ]
51
60
  },
52
61
  {
53
62
  "action": "gem-build",
54
- "files": ["*.gemspec"],
63
+ "files": [
64
+ "*.gemspec"
65
+ ],
55
66
  "publish": [
56
67
  {
57
68
  "action": "gem-push",
58
- "files": ["*.gem"],
69
+ "files": [
70
+ "*.gem"
71
+ ],
59
72
  "credentials": "lsegal.rubygems"
60
73
  }
61
74
  ]
62
75
  },
63
76
  {
64
77
  "action": "changelog-parse",
65
- "files": ["CHANGELOG.md"],
78
+ "files": [
79
+ "CHANGELOG.md"
80
+ ],
66
81
  "publish": [
67
82
  {
68
83
  "action": "github-release",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-02 00:00:00.000000000 Z
11
+ date: 2020-06-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lsegal@soen.ca
@@ -115,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.7.6
118
+ rubygems_version: 3.1.2
120
119
  signing_key:
121
120
  specification_version: 4
122
121
  summary: Samus helps you release Open Source Software.