Skip to content

Commit

Permalink
M3 post release updates: CHANGELOG, smoketest fix, archetype release …
Browse files Browse the repository at this point in the history
…fix (#1764)

* Fix MAVEN_ARGS in deploy-archetypes.sh
* Fix smoketest script
* Update CHANGELOG with M3 edits
* Restore github-release.sh
  • Loading branch information
barchetta authored May 11, 2020
1 parent a8348ac commit d5d1f61
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 10 deletions.
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

For Helidon 1.x releases please see [Helidon 1.x CHANGELOG.md](https://github.com/oracle/helidon/blob/helidon-1.x/CHANGELOG.md)

## [Unreleased]
## [Unreleased]

### Notes

This is the third milestone release of Helidon 2.0.
This is the fourth milestone release of Helidon 2.0.

### Notable New Features

### Changes

### Backward incompatible changes

## [2.0.0-M3]

### Notes

This is the third milestone release of Helidon 2.0. It contains significant new features,
enhancements and fixes. It also contains backward incompatible changes (see section below).
This milestone release is provided for customers that want early access to Helidon 2.0. It
should be considered unstable and is not intended for production use. APIs and features might
not be fully tested and are subject to change. Documentation is incomplete. Those looking
for a stable release should use a 1.4 release.

### Notable New Features

Expand Down Expand Up @@ -567,6 +584,7 @@ If there is no authorization provider configured, ABAC provider will be configur
otherwise they are ignored


[Unreleased]: https://github.com/oracle/helidon/compare/2.0.0-M2...HEAD
[Unreleased]: https://github.com/oracle/helidon/compare/2.0.0-M3...HEAD
[2.0.0-M3]: https://github.com/oracle/helidon/compare/2.0.0-M2...2.0.0-M3
[2.0.0-M2]: https://github.com/oracle/helidon/compare/2.0.0-M1...2.0.0-M2
[2.0.0-M1]: https://github.com/oracle/helidon/compare/1.4.0...2.0.0-M1
111 changes: 111 additions & 0 deletions etc/scripts/github-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/bin/bash
#
# Copyright (c) 2020 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -o pipefail || true # trace ERR through pipes
set -o errtrace || true # trace ERR through commands and functions
set -o errexit || true # exit the script if any statement returns a non-true return value

on_error(){
CODE="${?}" && \
set +x && \
printf "[ERROR] Error(code=%s) occurred at %s:%s command: %s\n" \
"${CODE}" "${BASH_SOURCE}" "${LINENO}" "${BASH_COMMAND}"
}
trap on_error ERR

usage(){
cat <<EOF
DESCRIPTION: Create a Github Release
USAGE:
$(basename ${0}) --changelog=PATH --version=x.y.z
--changelog=PATH
Path to the changelog file.
--version=x.y.z
The version to create the Github release for.
--help
Prints the usage and exits.
ENVIRONMENT:
GITHUB_API_KEY:
Github API key used to authenticate
EOF
}

# parse command line args
ARGS=( "${@}" )
for ((i=0;i<${#ARGS[@]};i++))
{
ARG=${ARGS[${i}]}
case ${ARG} in
"--changelog="*)
readonly CHANGELOG=${ARG#*=}
;;
"--version="*)
readonly VERSION=${ARG#*=}
;;
"--help")
usage
exit 0
;;
*)
if [ -z "${CHANGELOG}" ] || [ ! -f "${CHANGELOG}" ]; then
echo "ERROR: invalid changelog: ${CHANGELOG}."
exit 1
elif [ -z "${version}" ]; then
echo "ERROR: no version provided"
exit 1
fi
;;
esac
}

if [ -z "${GITHUB_API_KEY}" ] ; then
echo "ERROR: GITHUB_API_KEY is not set"
exit 1
fi

readonly GITHUB_API_URL="https://api.github.com"
readonly MEDIA_TYPE="application/vnd.github.v3+json"
readonly GITHUB_OWNER="oracle"
readonly REPO="helidon"

BODY=$(cat ${CHANGELOG} | awk '{printf "%s\\n", $0;}' | sed -e 's/"/\\"/g')
PAYLOAD="{
\"tag_name\": \"${VERSION}\",
\"name\": \"${VERSION}\",
\"body\": \"${BODY}\",
\"draft\": false,
\"prerelease\": false
}"

curl \
-vvv \
-w "%{http_code}" \
-u "${GITHUB_OWNER}:${GITHUB_API_KEY}" \
-H "Accept: ${MEDIA_TYPE}" \
-X POST \
-d "${PAYLOAD}" \
${GITHUB_API_URL}/repos/${GITHUB_OWNER}/${REPO}/releases

9 changes: 4 additions & 5 deletions etc/scripts/smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,13 @@ full(){
quick
cd ${SCRATCH}

echo "===== Checking out tags/${VERSION} ====="
if [[ "${VERSION}" =~ .*SNAPSHOT ]]; then
echo "WARNING! SNAPSHOT version. Skipping tag checkout"
else
echo "===== Cloning Workspace ${GIT_URL} ====="
git clone ${GIT_URL}
cd ${SCRATCH}/helidon
echo "===== Checking out tags/${VERSION} ====="
git checkout tags/${VERSION}
fi

Expand All @@ -183,10 +186,6 @@ full(){
done
fi

echo "===== Building examples ====="
cd ${SCRATCH}/helidon/examples
mvn ${MAVEN_ARGS} clean install ${STAGED_PROFILE}
cd ${SCRATCH}
}

waituntilready() {
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstarts/archetypes/deploy-archetypes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,7 +43,7 @@ else
fi

readonly MAVEN_DEPLOY_ARGS="org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy -DaltDeploymentRepository=ossrh::default::${MAVEN_REPO_URL}"
readonly MAVEN_ARGS="-B clean verify -DskipTests gpg:sign -Dgpg.passphase=${GPG_PASSPHRASE} ${MAVEN_DEPLOY_ARGS}"
readonly MAVEN_ARGS="${MAVEN_ARGS} clean verify -DskipTests gpg:sign ${MAVEN_DEPLOY_ARGS}"

${MY_DIR}/create-archetypes.sh \
--version="${MVN_VERSION}" \
Expand Down

0 comments on commit d5d1f61

Please sign in to comment.