-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run release without having any particular ruby installed locally
- Loading branch information
Showing
15 changed files
with
82 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
test.sh | ||
*.md | ||
.gitkeep | ||
script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pact_broker/pact_broker.sqlite | ||
pact_broker.sqlite | ||
pact_broker/log | ||
pact_broker/tmp | ||
pact_broker/tmp | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This file is used by the conventional changelog gem instead of the real git executable | ||
# inside the docker container, as using git in a docker container turns out to be ridiculously hard. | ||
# It echos a pre-created list of git commits, created in | ||
# script/prepare-git-log-extract-for-conventional-changelog.sh | ||
# Don't judge me. I've tried a LOT of things. | ||
|
||
cat /tmp/git-log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
gem_version_from_gemfile_lock() { | ||
grep "pact_broker (" pact_broker/Gemfile.lock | awk -F '[()]' '{print $2}' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
: "${TAG:?Please set the TAG environment variable}" | ||
|
||
source script/docker-functions | ||
|
||
docker_build_package_base | ||
|
||
$(dirname "$0")/prepare-git-log-extract-for-conventional-changelog.sh | ||
|
||
docker run --rm -it \ | ||
-e TAG=${TAG} \ | ||
-v ${PWD}/tmp/git-log:/tmp/git-log \ | ||
-v ${PWD}/CHANGELOG.md:/app/CHANGELOG.md \ | ||
dius_pact_broker_package_base \ | ||
sh -c "bundle exec rake generate_changelog" |
4 changes: 2 additions & 2 deletions
4
script/next-docker-tag.sh → script/release/next-docker-tag.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
script/release/prepare-git-log-extract-for-conventional-changelog.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env sh | ||
# Extracts the relevant commits from the git log for this release | ||
|
||
set -e | ||
|
||
rm -rf tmp; mkdir -p tmp | ||
|
||
export DELIMITER="/////" | ||
|
||
last_tag=$(grep "a name=" CHANGELOG.md | head -n 1 | cut -d \" -f2) | ||
|
||
# Use the same command that conventional-changelog uses to extract the relevant | ||
# lines from the git log | ||
# See https://github.com/dcrec1/conventional-changelog-ruby/blob/628565d00caed1f93461a3cd189fb40452066e71/lib/conventional_changelog/git.rb#L17-L20 | ||
|
||
git log --pretty=format:"%h${DELIMITER}%ad${DELIMITER}%s%x09" \ | ||
--date=short \ | ||
--grep="^(feat|fix)(\\(.*\\))?:" \ | ||
-E \ | ||
${last_tag}..HEAD > tmp/git-log | ||
|
||
echo "Extracted the following commits since ${last_tag}:" | ||
cat tmp/git-log | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env sh | ||
|
||
source script/docker-functions | ||
|
||
docker_build_package_base | ||
run_on_package_base "bundle exec rake spec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters