mirror of
https://github.com/superhelio/tools.git
synced 2026-01-27 19:45:26 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce422a3072 | ||
|
|
32f1d3b58f | ||
|
|
ad212fa78d | ||
|
|
6b020a6fbf | ||
|
|
a9fa72574a | ||
|
|
bea29b3ce3 | ||
|
|
f8af60b6b1 | ||
|
|
f58d1c50dd | ||
|
|
f25536b8a1 | ||
|
|
f711b92ba2 |
@@ -1,15 +0,0 @@
|
|||||||
; This file is for unifying the coding style for different editors and IDEs.
|
|
||||||
; More information at http://editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
/vendor/
|
|
||||||
/.idea/
|
|
||||||
52
CHANGELOG.md
52
CHANGELOG.md
@@ -1,55 +1,3 @@
|
|||||||
## 0.1.6 (2016-08-15)
|
|
||||||
- Added license (MIT)
|
|
||||||
- Expand release.sh section to contain requirements, features and usage
|
|
||||||
- New sections is README.md: How to use, Changelog, License
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.5...0.1.6)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.5 (2016-08-15)
|
|
||||||
- Add .editorconfig
|
|
||||||
- Ignore .idea folder
|
|
||||||
- Comment out unused variables (unused colors and BRANCH_CURRENT)
|
|
||||||
- Remove extra new line before Full changelog link
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.4...0.1.5)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.4 (2016-08-11)
|
|
||||||
- Fix changelog url generation
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.3...0.1.4)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.3 (2016-08-11)
|
|
||||||
- Fix ssh remote url, convert to https
|
|
||||||
- Take account diffs in bitbucket and github changelog urls
|
|
||||||
- Reverse commit message list
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.2...0.1.3)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.2 (2016-08-10)
|
|
||||||
- Explicitly push tags
|
|
||||||
- Better wording to push question
|
|
||||||
- Fix changelog url
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.1...0.1.2)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.1 (2016-08-10)
|
|
||||||
- Echo into the temp file, not to the screen
|
|
||||||
|
|
||||||
[Full changelog](https://github.com/superhelio/tools/compare/0.1.0...0.1.1)
|
|
||||||
|
|
||||||
|
|
||||||
## 0.1.0 (2016-08-10)
|
|
||||||
- Remove paging from git log, works better for automation
|
|
||||||
- Change changelog formatting to simple message
|
|
||||||
- Add link to full changelog, detect project url from origin url
|
|
||||||
- Add composer.json, ignore vendor folder
|
|
||||||
|
|
||||||
|
|
||||||
## 0.0.10 (2016-08-04)
|
## 0.0.10 (2016-08-04)
|
||||||
- db2367d 2016-08-04 | Create the README.md (HEAD -> release-0.0.10, develop) [Ismo Vuorinen]
|
- db2367d 2016-08-04 | Create the README.md (HEAD -> release-0.0.10, develop) [Ismo Vuorinen]
|
||||||
- 0140b53 2016-08-04 | Implement [shellcheck](https://www.shellcheck.net/) recommendations [Ismo Vuorinen]
|
- 0140b53 2016-08-04 | Implement [shellcheck](https://www.shellcheck.net/) recommendations [Ismo Vuorinen]
|
||||||
|
|||||||
21
LICENSE.md
21
LICENSE.md
@@ -1,21 +0,0 @@
|
|||||||
# The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2016 SuperHelio Oy <hello@superhelio.com>
|
|
||||||
|
|
||||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
> of this software and associated documentation files (the "Software"), to deal
|
|
||||||
> in the Software without restriction, including without limitation the rights
|
|
||||||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
> copies of the Software, and to permit persons to whom the Software is
|
|
||||||
> furnished to do so, subject to the following conditions:
|
|
||||||
>
|
|
||||||
> The above copyright notice and this permission notice shall be included in
|
|
||||||
> all copies or substantial portions of the Software.
|
|
||||||
>
|
|
||||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
> THE SOFTWARE.
|
|
||||||
24
README.md
24
README.md
@@ -2,26 +2,6 @@
|
|||||||
|
|
||||||
Collection of cool tools that make life easier.
|
Collection of cool tools that make life easier.
|
||||||
|
|
||||||
## The tools
|
## Scripts
|
||||||
|
|
||||||
- [release.sh](release.sh) - [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) release flow with automatic version bumping and changelog updating.
|
- [release.sh](https://github.com/superhelio/tools/blob/master/release.sh) - Git Flow release flow with automatic version bumping
|
||||||
- **Requires:** `bash`, `git` and `sed`
|
|
||||||
- **Features:**
|
|
||||||
- Helps you [keep your CHANGELOG.md up to date](http://keepachangelog.com/): Lists your commit messages, gives you a change to modify results before committing.
|
|
||||||
- Supports GitHub and Bitbucket tag comparison urls
|
|
||||||
- **Usage:**
|
|
||||||
- Commit everything, run `release.sh` and follow directions
|
|
||||||
|
|
||||||
## How to use in your project
|
|
||||||
|
|
||||||
We try to keep this as easy as possible to include to your projects, so we are open to pull requests.
|
|
||||||
|
|
||||||
Currently we have [composer.json](composer.json) that installs the tools to your `vendor/bin` folder, you can [include the project as git submodule](https://gist.github.com/gitaarik/8735255) or just copy the files to your project. Which ever works best for you.
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. We use [release.sh](release.sh) to update the CHANGELOG.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "superhelio/tools",
|
|
||||||
"description": "Collection of our tools",
|
|
||||||
"type": "library",
|
|
||||||
"license": "MIT",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Ismo Vuorinen",
|
|
||||||
"email": "ismo.vuorinen@superhelio.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {},
|
|
||||||
"bin": [
|
|
||||||
"release.sh"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
32
release.sh
32
release.sh
@@ -17,20 +17,16 @@ NOW="$(date +'%Y-%m-%d')"
|
|||||||
RED="\033[1;31m"
|
RED="\033[1;31m"
|
||||||
GREEN="\033[0;32m"
|
GREEN="\033[0;32m"
|
||||||
YELLOW="\033[1;33m"
|
YELLOW="\033[1;33m"
|
||||||
#BLUE="\033[1;34m"
|
BLUE="\033[1;34m"
|
||||||
#PURPLE="\033[1;35m"
|
PURPLE="\033[1;35m"
|
||||||
CYAN="\033[1;36m"
|
CYAN="\033[1;36m"
|
||||||
WHITE="\033[1;37m"
|
WHITE="\033[1;37m"
|
||||||
#RESET="\033[0m"
|
RESET="\033[0m"
|
||||||
|
|
||||||
LATEST_HASH=$(git log --pretty=format:'%h' -n 1)
|
LATEST_HASH=$(git log --pretty=format:'%h' -n 1)
|
||||||
|
|
||||||
# Guess our remote url from remote.origin.url. Used to create Changelog link.
|
|
||||||
# You can change this to your project url, but detection should cover 99%.
|
|
||||||
PROJECT_URL=$(git config --get remote.origin.url | sed 's/\.git//' | sed 's/\:/\//' | sed 's/git@/https\:\/\//' | sed 's/\/\/\//\:\/\//')
|
|
||||||
|
|
||||||
# current Git branch
|
# current Git branch
|
||||||
#BRANCH_CURRENT=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
BRANCH_CURRENT=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
||||||
|
|
||||||
# establish branch and tag name variables
|
# establish branch and tag name variables
|
||||||
BRANCH_DEV=develop
|
BRANCH_DEV=develop
|
||||||
@@ -114,24 +110,9 @@ git checkout -b "$BRANCH_RELEASE" "$BRANCH_DEV"
|
|||||||
# Set our new version to our version file
|
# Set our new version to our version file
|
||||||
echo "$NEW_VERSION" > "$FILE_VERSION"
|
echo "$NEW_VERSION" > "$FILE_VERSION"
|
||||||
|
|
||||||
# Fix compare url based on BitBucket or Github, default to GitHub
|
|
||||||
if [[ "$PROJECT_URL" == *bitbucket.org* ]]; then
|
|
||||||
# https://bitbucket.org/vendor/project/branches/compare/_NEW_%0D_OLD_
|
|
||||||
VER_COMP_STR='branches/compare'
|
|
||||||
VER_COMP_SEP='%0D'
|
|
||||||
VER_COMP_TAG="$NEW_VERSION$VER_COMP_SEP$BASE_STRING"
|
|
||||||
else
|
|
||||||
# https://github.com/vendor/project/compare/_OLD_..._NEW_
|
|
||||||
VER_COMP_STR='compare'
|
|
||||||
VER_COMP_SEP='...'
|
|
||||||
VER_COMP_TAG="$BASE_STRING$VER_COMP_SEP$NEW_VERSION"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create our changelog
|
# Create our changelog
|
||||||
echo "## $NEW_VERSION ($NOW)" > tmpfile
|
echo "## $NEW_VERSION ($NOW)" > tmpfile
|
||||||
git --no-pager log --pretty=format:" - %s" --date=short --no-merges "$BASE_STRING"...HEAD | sed -n '1!G;h;$p' >> tmpfile
|
git log --pretty=format:" - %h %ad | %s%d [%an]" --date=short --no-merges "$BASE_STRING"...HEAD >> tmpfile
|
||||||
echo "" >> tmpfile
|
|
||||||
echo "[Full changelog]($PROJECT_URL/$VER_COMP_STR/$VER_COMP_TAG)" >> tmpfile
|
|
||||||
echo "" >> tmpfile
|
echo "" >> tmpfile
|
||||||
echo "" >> tmpfile
|
echo "" >> tmpfile
|
||||||
cat "$FILE_CHANGELOG" >> tmpfile
|
cat "$FILE_CHANGELOG" >> tmpfile
|
||||||
@@ -161,12 +142,11 @@ git merge --no-ff "$BRANCH_RELEASE"
|
|||||||
# Remove release branch
|
# Remove release branch
|
||||||
git branch -d "$BRANCH_RELEASE"
|
git branch -d "$BRANCH_RELEASE"
|
||||||
|
|
||||||
echo -ne "${QUESTION_FLAG} ${CYAN}Push everything to origin?"
|
echo -ne "${QUESTION_FLAG} ${CYAN}Push?"
|
||||||
|
|
||||||
read -r PUSH
|
read -r PUSH
|
||||||
if [[ $PUSH =~ [yY](es)* ]] || [ "$PUSH" = "" ]; then
|
if [[ $PUSH =~ [yY](es)* ]] || [ "$PUSH" = "" ]; then
|
||||||
git push --all origin
|
git push --all origin
|
||||||
git push --tags origin
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${NOTICE_FLAG} Done!"
|
echo -e "${NOTICE_FLAG} Done!"
|
||||||
|
|||||||
Reference in New Issue
Block a user