Skip to content

Commit

Permalink
Merge pull request #79 from galasa-dev/mcobbett-framework-version-set…
Browse files Browse the repository at this point in the history
…-from-top

mcobbett framework version set from top
  • Loading branch information
techcobweb authored Nov 27, 2024
2 parents 2257207 + 7f5aa82 commit 25d95e6
Show file tree
Hide file tree
Showing 36 changed files with 284 additions and 66 deletions.
107 changes: 107 additions & 0 deletions modules/buildutils/set-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#! /usr/bin/env bash

#
# Copyright contributors to the Galasa project
#
# SPDX-License-Identifier: EPL-2.0
#

#-----------------------------------------------------------------------------------------
#
# Objectives: Sets the version number of this component.
#
# Environment variable over-rides:
# None
#
#-----------------------------------------------------------------------------------------

# Where is this script executing from ?
BASEDIR=$(dirname "$0");pushd $BASEDIR 2>&1 >> /dev/null ;BASEDIR=$(pwd);popd 2>&1 >> /dev/null
# echo "Running from directory ${BASEDIR}"
export ORIGINAL_DIR=$(pwd)
# cd "${BASEDIR}"

cd "${BASEDIR}/.."
WORKSPACE_DIR=$(pwd)


#-----------------------------------------------------------------------------------------
#
# Set Colors
#
#-----------------------------------------------------------------------------------------
bold=$(tput bold)
underline=$(tput sgr 0 1)
reset=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 76)
white=$(tput setaf 7)
tan=$(tput setaf 202)
blue=$(tput setaf 25)

#-----------------------------------------------------------------------------------------
#
# Headers and Logging
#
#-----------------------------------------------------------------------------------------
underline() { printf "${underline}${bold}%s${reset}\n" "$@" ;}
h1() { printf "\n${underline}${bold}${blue}%s${reset}\n" "$@" ;}
h2() { printf "\n${underline}${bold}${white}%s${reset}\n" "$@" ;}
debug() { printf "${white}%s${reset}\n" "$@" ;}
info() { printf "${white}➜ %s${reset}\n" "$@" ;}
success() { printf "${green}✔ %s${reset}\n" "$@" ;}
error() { printf "${red}✖ %s${reset}\n" "$@" ;}
warn() { printf "${tan}➜ %s${reset}\n" "$@" ;}
bold() { printf "${bold}%s${reset}\n" "$@" ;}
note() { printf "\n${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" ;}


#-----------------------------------------------------------------------------------------
# Functions
#-----------------------------------------------------------------------------------------
function usage {
h1 "Syntax"
cat << EOF
set-version.sh [OPTIONS]
Options are:
-v | --version xxx : Mandatory. Set the version number to something explicitly.
Re-builds the release.yaml based on the contents of sub-projects.
For example '--version 0.29.0'
EOF
}

#-----------------------------------------------------------------------------------------
# Process parameters
#-----------------------------------------------------------------------------------------
component_version=""

while [ "$1" != "" ]; do
case $1 in
-v | --version ) shift
export component_version=$1
;;
-h | --help ) usage
exit
;;
* ) error "Unexpected argument $1"
usage
exit 1
esac
shift
done

if [[ -z $component_version ]]; then
error "Missing mandatory '--version' argument."
usage
exit 1
fi


temp_dir=$BASEDIR/temp/version_bump
mkdir -p $temp_dir

# The root command of the galasabld tool has a version inside the cobra command.
cat $BASEDIR/pkg/cmd/root.go | sed "s/^.*Version[:].*$/ Version: \"$component_version\",/1" > $temp_dir/root.go.txt
cp $temp_dir/root.go.txt $BASEDIR/pkg/cmd/root.go


2 changes: 1 addition & 1 deletion modules/extensions/galasa-extensions-parent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

allprojects {
group = 'dev.galasa'
version = "0.38.0"
version = '0.38.0'
}

//---------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion modules/framework/galasa-parent/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'biz.aQute.bnd.builder' version '5.3.0' apply false
id 'dev.galasa.githash' version '0.15.0' apply false
id 'dev.galasa.githash' version "0.38.0" apply false
id 'jacoco'
id 'maven-publish'
id 'signing'
Expand All @@ -11,6 +11,11 @@ plugins {
// It is also read by other build scrips as required.
version = "0.38.0"

allprojects {
group = 'dev.galasa'
version = "0.38.0"
}

signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'Galasa Authentication API'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'Framework API - Common Packages'

version = '0.38.0'

dependencies {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API - Bootstrap'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'Framework API - Common Packages'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API - CPS'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API Health Servlets'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API launcher'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API - OpenAPI Servlet'

version = '0.38.0'

configurations {
openApiSpec
openApiSpec.transitive = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'Galasa Open API specification'

version = "0.38.0"

repositories {
maven {
url "$sourceMaven"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ plugins {

description = 'Galasa API - RAS'

version '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ plugins {

description = 'Galasa API - Resources'

version '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa Runs API'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API - Secrets'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa API Test Catalog'

version = "0.38.0"

dependencies {
implementation project(':dev.galasa.framework')
implementation 'commons-io:commons-io'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'Galasa Users API'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.beans')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Framework API'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation 'org.apache.felix:org.apache.felix.bundlerepository'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {

description = 'Galasa Auth SPI'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation project(':dev.galasa.framework.api.common')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Docker Controller'

version '0.38.0'

dependencies {
implementation project(':dev.galasa')
implementation project(':dev.galasa.framework')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa Kubernetes Controller'

version '0.38.0'

dependencies {
implementation project(':dev.galasa')
implementation project(':dev.galasa.framework')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa log4j2 Bridge'

version = "0.38.0"

dependencies {
implementation 'org.apache.logging.log4j:log4j-api'
implementation 'org.apache.logging.log4j:log4j-core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
id 'galasa.framework'
}

version = '0.21.0'

description = 'Galasa Maven Repository SPI'

// Note: These values are consumed by the parent build process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa Maven Repository '

version = '0.38.0'

dependencies {
compileOnly project(':dev.galasa.framework.maven.repository.spi')
implementation 'org.apache.maven:maven-repository-metadata'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa Metrics'

version = '0.38.0'

dependencies {
implementation project(':dev.galasa.framework')
implementation 'io.prometheus:simpleclient'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {

description = 'Galasa Resource Management'

version = '0.38.0'

dependencies {
implementation project (':dev.galasa.framework')
implementation 'io.prometheus:simpleclient'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ plugins {

description = 'Galasa Framework'

// Note: The following line is changed by the set-version.sh script.
// It is also read by other build scrips as required.
version = "0.38.0"

dependencies {
api project (':dev.galasa')

Expand Down
2 changes: 0 additions & 2 deletions modules/framework/galasa-parent/dev.galasa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
id 'galasa.framework'
}

version = '0.38.0'

description = 'Galasa Testers Programmer Interface (TPI)'

// Note: These values are consumed by the parent build process
Expand Down
2 changes: 0 additions & 2 deletions modules/framework/galasa-parent/galasa-boot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ configurations {

}

version = '0.38.0'

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
Expand Down
4 changes: 2 additions & 2 deletions modules/framework/galasa-parent/galasa-demo-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>dev.galasa</groupId>
<artifactId>galasa-parent</artifactId>
<version>0.15.0</version>
<version>0.38.0</version>
</parent>

<artifactId>galasa-demo-archetype</artifactId>
<version>0.15.0</version>
<version>0.38.0</version>
<packaging>maven-archetype</packaging>

<build>
Expand Down
Loading

0 comments on commit 25d95e6

Please sign in to comment.