Project

General

Profile

Revision 5099654c

Added by Daniel Lobato Garcia over 7 years ago

Fixes #11204 - Automate rubygem release

View differences:

release/RELEASE.md
4 4
It should serve as a reference to the person doing the release, however the project should
5 5
strive to automate as much as possible of this process.
6 6

  
7
A preliminary script for all actions required in this repository can be found under this repository
8
under the namerollout-release.
9

  
7 10
## Versioning
8 11

  
9 12
`foreman-docker` follows [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html). This means:
release/rollout-release
1
#!/bin/bash
2

  
3
GITHUB_TOKEN=$(cat ~/.codereview)
4
RED='\e[31m';
5
GREEN='\e[32m';
6

  
7
echo -e "${GREEN} foreman-docker releaser $1\033[0m"
8
echo -e "${GREEN} Current version: $(grep VERSION lib/foreman_docker/version.rb) $1\033[0m"
9
echo -e "${GREEN} -- Checking out branch master $1\033[0m"
10
hub checkout master --quiet
11
if [ $? -ne 0 ]; then
12
  echo -e "${RED} -- Error checking out master branch. Aborting... \033[0m"
13
  exit 1
14
fi
15
read -p "What version are we going to release today? : " VERSION
16
sed -i s/"VERSION = .*"/"VERSION = '${VERSION}'"/g  lib/foreman_docker/version.rb
17

  
18
echo -e "${GREEN} -- Creating contributors list and CHANGELOG $1\033[0m"
19
./release/changelog
20

  
21
echo -e "${GREEN} -- Commiting version bump $1\033[0m"
22
git add lib/foreman_docker/version.rb
23
git add CHANGELOG
24
git add Contributors
25
git commit -m "Bump version to ${VERSION}"
26
git push upstream master
27

  
28
echo -e "${GREEN} -- Tagging version ${VERSION} $1\033[0m"
29
git tag ${VERSION}
30
git push upstream ${VERSION}
31

  
32
MAJOR_VERSION=$(echo $VERSION | cut -c1)
33
echo -e "${GREEN} -- Checking out stable branch ${MAJOR_VERSION} $1\033[0m"
34
git checkout ${MAJOR_VERSION}.0-stable
35
git pull --rebase upstream master
36
git push upstream ${MAJOR_VERSION}.0-stable
37

  
38
echo -e "${GREEN} -- Pushing ${VERSION} to rubygems $1\033[0m"
39
gem build foreman_docker.gemspec
40
gem push foreman-docker-${VERSION}.gem
41

  
42
echo -e "${GREEN} -- Done! Gem is published in rubygems and your repository is tagged. $1\033[0m"
43
echo -e "${GREEN} -- To complete the release just update the version on foreman-packaging rpm/deb packages, $1\033[0m"
44
echo -e "${GREEN} -- and submit a pull request to rpm/develop and deb/develop.$1\033[0m"

Also available in: Unified diff