Skip to content

Commit

Permalink
feat(deps): script to bump dependencies
Browse files Browse the repository at this point in the history
A script to automate the major dependency upgrades.
  • Loading branch information
squakez committed May 27, 2022
1 parent b28889e commit 9a59d44
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ image:https://github.com/apache/camel-k-runtime/workflows/Build/badge.svg["Build

This repository contains the Apache Camel-K Runtime bits used by the https://github.com/apache/camel-k[_main project_]

== How to bump the main dependencies

In order to simplify the maintenance, you can use a script in `/script/` directory which take care of bumping the versions for the project. As we maintain a BOM which is not inheriting the main project parent, this is very handy to keep versions aligned. Instructions how to run the script:
....
Usage: ./script/bump.sh [options]
--version Bump Camel K runtime version
--camel Bump Camel version
--camel-quarkus Bump Camel-Quarkus version
--quarkus Bump Quarkus version
--graalvm Bump GraalVM version
--help This help message
Example: ./script/bump.sh --version 1.14.0-SNAPSHOT --camel 3.16.0
....

== Instructions for local debugging

You can https://camel.apache.org/camel-k/latest/contributing/local-development.html#_local_camel_k_runtime[follow these instructions] in order to run and debug a Camel K integration based on a local Camel K runtime.
98 changes: 98 additions & 0 deletions scripts/bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/bin/bash

set -e

display_usage() {

cat <<EOF
Bump Camel K Runtime project Camel and Quarkus related dependencies
Usage: ./script/bump.sh [options]
--version Bump Camel K runtime version
--camel Bump Camel version
--camel-quarkus Bump Camel-Quarkus version
--quarkus Bump Quarkus version
--graalvm Bump GraalVM version
--help This help message
Example: ./script/bump.sh --version 1.14.0-SNAPSHOT --camel 3.16.0
EOF

}

VERSION=""
CAMEL=""
CAMELQUARKUS=""
QUARKUS=""
GRAALVM=""

main() {
parse_args $@

if [[ ! -z "$VERSION" ]]; then
mvn versions:set -DnewVersion="$VERSION" -DgenerateBackupPoms=false
mvn versions:set -DnewVersion="$VERSION" -f support/camel-k-runtime-bom/pom.xml -DgenerateBackupPoms=false
echo "Camel K runtime project set to $VERSION"
fi

if [[ ! -z "$CAMEL" ]]; then
mvn versions:set-property -Dproperty="camel-version" -DnewVersion="$CAMEL"
echo "Camel version set to $CAMEL"
fi

if [[ ! -z "$CAMELQUARKUS" ]]; then
mvn versions:set-property -Dproperty="camel-quarkus-version" -DnewVersion="$CAMELQUARKUS"
echo "Camel Quarkus version set to $CAMELQUARKUS"
fi

if [[ ! -z "$QUARKUS" ]]; then
mvn versions:set-property -Dproperty="quarkus-version" -DnewVersion="$QUARKUS"
echo "Quarkus platform version set to $QUARKUS"
fi

if [[ ! -z "$GRAALVM" ]]; then
mvn versions:set-property -Dproperty="graalvm-version" -DnewVersion="$GRAALVM"
echo "GraalVM version set to $GRAALVM"
fi
}

parse_args(){
while [ $# -gt 0 ]
do
arg="$1"
case $arg in
-h|--help)
display_usage
exit 0
;;
--version)
shift
VERSION="$1"
;;
--camel)
shift
CAMEL="$1"
;;
--camel-quarkus)
shift
CAMELQUARKUS="$1"
;;
--quarkus)
shift
QUARKUS="$1"
;;
--graalvm)
shift
GRAALVM="$1"
;;
*)
echo "❗ unknown argument: $1"
display_usage
exit 1
;;
esac
shift
done
}

main $*
2 changes: 1 addition & 1 deletion support/camel-k-runtime-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime-bom</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.14.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down

0 comments on commit 9a59d44

Please sign in to comment.