<commit_before>#!/bin/bash
#
# How-to release a new version of SF:
#
#  1/ First edit role_configrc to set new and previous version strings:
# VER=2.1.6
# SF_PREVIOUS_VER=C7.0-2.1.5
#
#  2/ Commit using 'TaggedRelease: 2.1.5' (the actual release version, not the VER)
#  3/ Run this script to update references
#  4/ Check subproject history + sf history to update changelog
#  5/ Generate changelog with "reno report ." and copy the output to the CHANGELOG file
#     reno use a tag to compute the release version, remember to update version acording 'TaggedRelease' number in the CHANGELOG file.
#  6/ Commit --amend with all changes and new symlinks
#  7/ Wait for change to be merged (ask for review, recheck gate)
#  8/ Test new releases (either deploy or upgrade), in particular the changelog
#  9/ If published build is good, sign and re-publish the digest
#     gpg -u <EMAIL> --clearsign softwarefactory-C7.0-${VER}.digest
#     mv softwarefactory-C7.0-${VER}.digest.asc softwarefactory-C7.0-${VER}.digest
#     publish softwarefactory-C7.0-${VER}.digest to swift
# 10/ Generate package diff: diff previous_release.description new_release.description
# 11/ Prepare mail, see previous announcement for template (re-use doug famous introduction from http://lists.openstack.org/pipermail/openstack-announce/)
# 12/ Tag: git tag -s -a -m "${VER}" ${VER} HEAD
# 13/ Submit tag: git push --tags gerrit
# 14/ Send announcement
#
. ./role_configrc

DEPS='/var/lib/sf/deps'

if [ "${TAGGED_RELEASE}" != "1" ]; then
    echo Run this script on a TaggedRelease: commit only<commit_msg>Add some more details to the release process howto<commit_after>#!/bin/bash
#
# How-to release a new version of SF
# ==================================
#
# In this example, we release 2.1.8:
#
#  1/ First edit role_configrc to set new and previous version strings:
#     VER=2.1.9                  # after the taggedrelease commit merges, this would be the next branch version
#     SF_PREVIOUS_VER=C7.0-2.1.8 # after the taggedrelease commit merge, this would be the next prev version
#
#       Note that, for this special taggedrelease commit, those value get changed in the REL_VER condition.
#       The SF_PREVIOUS_VER can be adjusted to match a more relevant upgrade path, such as last deployed release.
#
#  2/ Commit using 'TaggedRelease: 2.1.8'
#  3/ Run this script. Commands will be display in the term you have to exec them
#  4/ Check subproject history + sf history to update changelog
#  4.1/ Create the reno file with "reno new 2.1.8-release" and fill it then "git commit --amend"
#  5/ Generate changelog with "reno report ." and copy the output to the CHANGELOG file
#     reno use a tag to compute the release version,
#  6/ update version acording 'TaggedRelease' number in the CHANGELOG file
#  7/ Commit --amend with all changes and new symlinks
#  8/ Wait for change to be build and validated inside the CI (ask for review, recheck gate)
#  8.1/ If image is not published automatically (the case today)
#       build the image localy:
#       sudo rm -Rf /var/lib/sf/roles/cache/sf-centos7*
#       DEBUG=1 BUILD_QCOW=1 ./build_image.sh
#       run TEMP_URL_KEY=XXXX ./publish_image.sh
#  9/ Test new releases (either deploy or upgrade), in particular the changelog
# 10/ If published build is good, sign and re-publish the digest. You need the
#     passwordstore for this, set it up if not yet done:
#     sudo yum install -y pass
#     git clone ssh://<EMAIL>:29418/SF_password_store
#     source SF_password_store/.passrc
#     pass show <EMAIL>/passphrase
#     pass show <EMAIL> | gpg --import
# 11/ Download the actual digest
#     swift -A http://${SWIFTIP}:8080/auth/v1.0 -U sf:owner -K ${SWIFTPASS} download sf-images softwarefactory-${RELEASE_VER}.digest
# 12/ Sign the digest:
#     gpg -u <EMAIL> --clearsign softwarefactory-${RELEASE_VER}.digest
# 13/ upload the signed digest to Swift:
#     mv softwarefactory-C7.0-${RELEASE_VER}.digest.asc softwarefactory-${RELEASE_VER}.digest
#     swift -A http://${SWIFTIP}:8080/auth/v1.0 -U sf:owner -K ${SWIFTPASS} upload sf-images softwarefactory-${RELEASE_VER}.digest
# 14/ Generate package diff
#     curl -O http://${SWIFTIP}:8080/v1/AUTH_sf/sf-images/softwarefactory-${OLD_RELEASE_VER}.description
#     curl -O http://${SWIFTIP}:8080/v1/AUTH_sf/sf-images/softwarefactory-${RELEASE_VER}.description
#     diff --suppress-common-lines softwarefactory-${OLD_RELEASE_VER}.description softwarefactory-${RELEASE_VER}.description | egrep "[>|<]" > /tmp/release-diff
# 15/ Prepare mail, see previous announcement for template (re-use doug famous introduction from http://lists.openstack.org/pipermail/openstack-announce/)
# 16/ Tag: git tag -s -a -m "2.1.8" 2.1.8 HEAD
# 17/ Submit tag: git push --tags gerrit
# 18/ Send announcement
#
. ./role_configrc

DEPS='/var/lib/sf/deps'

if [ "${TAGGED_RELEASE}" != "1" ]; then
    echo Run this script on a TaggedRelease: commit only
{'fraction_non_alphanumeric': 0.11426256077795786, 'fraction_numerical': 0.025526742301458672, 'mean_word_length': 3.6097105508870215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4404717', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1547, 'n_words': 577}