2016-01-21 23:42:57 -05:00
Table of Contents:
==================
- [Branches and Tags: ](#branches-and-tags )
2020-04-29 20:38:58 -04:00
- [Testing: ](#testing )
2016-01-21 23:42:57 -05:00
- [Build Tasks ](#build-tasks )
- [Stable Releases ](#stable-releases )
- [Production Releases ](#production-releases )
- [Updating MacPorts (automatic) ](#updating-macports-automatic )
- [Updating MacPorts (manual) ](#updating-macports-manual )
Branches and Tags:
==================
2015-01-26 20:26:05 +00:00
There are 3 branches/tags:
2016-01-21 23:42:57 -05:00
- **HEAD:** The cutting edge of development.
- **tag stable:** Stable enough for use by most people.
- **tag production:** Burned in long enough that we are confident it can be widely adopted.
2015-01-26 20:26:05 +00:00
2017-12-15 21:49:48 +00:00
If you are packaging BlackBox for distribution, you should track the *tag production* . You might also want to provide a separate package that tracks *tag stable:* for early adopters.
2015-01-26 20:26:05 +00:00
2020-04-29 20:38:58 -04:00
Testing
=======
Tips:
* macOS: `brew install gpg pinentry`
* FreeBSD: `pkg install gpg gmake`
* CentOS7: `yum install gpg`
To run a suite of tests:
```
cd ~/src/github.com/StackExchange/blackbox
make test
```
FYI: For FreeBSD, use `gmake test`
2016-01-21 23:42:57 -05:00
Build Tasks
===========
2015-01-26 20:26:05 +00:00
2016-01-21 23:42:57 -05:00
Stable Releases
===============
2015-01-26 20:26:05 +00:00
Marking the software to be "stable":
2017-02-16 15:41:59 -05:00
Step 1. Update CHANGELOG.md
Use "git log" to see what has changed and update CHANGELOG.md.
For a new release, add:
```
echo Release v1.$(date +%Y%m%d)
```
Commit with:
```
git commit -m'Update CHANGELOG.md' CHANGELOG.md
```
Step 2. Tag it.
2015-01-26 20:30:06 +00:00
2015-01-26 20:26:05 +00:00
```
git pull
git tag -d stable
git push origin :stable
git tag stable
git push origin tag stable
```
2017-02-16 15:41:59 -05:00
Step 3. Mark your calendar 1 week from today to check to see if this should be promoted to production.
2015-01-26 20:30:06 +00:00
2016-01-21 23:42:57 -05:00
Production Releases
===================
2015-01-26 20:26:05 +00:00
If no bugs have been reported a full week after a stable tag has been pushed, mark the release to be "production".
```
git fetch
git checkout stable
git tag -d production
git push origin :production
git tag production
git push origin tag production
R="v1.$(date +%Y%m%d)"
git tag "$R"
2015-02-03 11:12:52 -05:00
git push origin tag "$R"
```
2015-02-22 11:25:42 -05:00
2018-12-19 20:20:44 -05:00
Step 4. Get credit!
Record the fact that you did this release in your weekly accomplishments file.
2016-01-21 23:42:57 -05:00
Updating MacPorts (automatic)
=============================
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
Step 1: Generate the Portfile
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
```
tools/macports_report_upgrade.sh 1.20150222
```
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
This script will generate a file called `Portfile-vcs_blackbox.diff` and instructions on how to submit it as a update request.
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
Step 2: Submit the update request.
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
Submit the diff file as a bug as instructed. The instructions should look like this:
2015-02-22 11:25:42 -05:00
2016-01-21 23:42:57 -05:00
- PLEASE OPEN A TICKET WITH THIS INFORMATION: https://trac.macports.org/newticket
- Summary: `vcs_blackbox @1.20150222 Update to latest upstream`
- Description: `New upstream of vcs_blackbox.
github.setup and checksums updated.`
- Type: `update`
- Component: `ports`
- Port: `vcs_blackbox`
- Keywords: `maintainer haspatch`
- Attach this file: `Portfile-vcs_blackbox.diff`
2015-02-22 13:31:27 -05:00
Step 3: Watch for the update to happen.
2018-04-30 13:49:52 -04:00
2016-01-21 23:42:57 -05:00
Updating MacPorts (manual)
==========================
2015-02-22 13:31:27 -05:00
2016-01-21 23:42:57 -05:00
This is the old, manual, procedure. If the automated procedure fails to work, these notes may or may not be helpful.
2015-02-22 13:31:27 -05:00
2016-01-21 23:42:57 -05:00
The ultimate result of the script should be the output of `diff -u Portfile.orig Portfile` which is sent as an attachment to MacPorts. The new `Portfile` should have these changes:
2015-02-22 13:31:27 -05:00
2016-01-21 23:42:57 -05:00
1. The `github.setup` line should have a new version number.
2. The `checksums` line(s) should have updated checksums.
2015-02-22 13:31:27 -05:00
How to generate the checksums?
2016-01-21 23:42:57 -05:00
The easiest way is to to make a Portfile with incorrect checksums, then run `sudo port -v checksum vcs_blackbox` to see what they should have been. Fix the file, and try again until the checksum command works.
2015-02-22 13:31:27 -05:00
2015-07-30 13:52:04 -04:00
Next run `port lint vcs_blackbox` and make sure it has no errors.
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
Some useful commands:
2015-02-22 11:25:42 -05:00
2015-02-22 13:31:27 -05:00
Change repos in sources.conf:
2016-01-21 23:42:57 -05:00
2015-02-22 13:31:27 -05:00
```
sudo vi /opt/local/etc/macports/sources.conf
Add this line early in the file:
file:///var/tmp/ports
```
2015-07-30 13:52:04 -04:00
Add a local repo:
2016-01-21 23:42:57 -05:00
2015-02-22 13:31:27 -05:00
```
fgrep >/dev/null -x 'file:///var/tmp/ports' /opt/local/etc/macports/sources.conf || sudo sed -i -e '1s@^@file:///var/tmp/ports \'$'\n@' /opt/local/etc/macports/sources.conf
```
2015-07-30 13:52:04 -04:00
Remove the local repo:
2016-01-21 23:42:57 -05:00
2015-02-22 13:31:27 -05:00
```
sudo sed -i -e '\@^file:///var/tmp/ports@d ' /opt/local/etc/macports/sources.conf
```
Test a Portfile:
2016-01-21 23:42:57 -05:00
```
2015-02-22 13:31:27 -05:00
sudo port uninstall vcs_blackbox
sudo port clean --all vcs_blackbox
rm -rf ~/.macports/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/security/vcs_blackbox/
rm -rf /var/tmp/ports
mkdir -p /var/tmp/ports/security/vcs_blackbox
cp Portfile /var/tmp/ports/security/vcs_blackbox
cd /var/tmp/ports & & portindex
sudo port -v checksum vcs_blackbox
sudo port install vcs_blackbox
2015-07-30 13:52:04 -04:00
```