diff --git a/build.sh b/scripts/build.sh similarity index 92% rename from build.sh rename to scripts/build.sh index a1e6dc4..51afd95 100755 --- a/build.sh +++ b/scripts/build.sh @@ -2,10 +2,11 @@ # Default values for parameters PUSH= +REPO_DIR=$(dirname $0)/.. #MacOSX M architecture: linux/arm64/v8 PLATFORM="linux/amd64" IMAGE_PREFIX="app-simulator" -VERSION=$(./bumpversion.sh) +VERSION=$($REPO_DIR/scripts/bumpversion.sh) # Function to display help show_help() { @@ -45,7 +46,7 @@ for ARG in "$@"; do esac done -for DIR in services/*; +for DIR in $REPO_DIR/src/services/*; do if [ -d $DIR ] ; then IMAGE_TAG="${IMAGE_PREFIX}/services-$(basename "$DIR"):$VERSION" @@ -55,7 +56,7 @@ do fi done; -for DIR in loaders/*; +for DIR in $REPO_DIR/src/loaders/*; do if [ -d $DIR ] ; then IMAGE_TAG="${IMAGE_PREFIX}/loaders-$(basename "$DIR"):$VERSION" diff --git a/bumpversion.sh b/scripts/bumpversion.sh similarity index 78% rename from bumpversion.sh rename to scripts/bumpversion.sh index 45da0a3..f50a10c 100755 --- a/bumpversion.sh +++ b/scripts/bumpversion.sh @@ -1,18 +1,19 @@ #!/bin/bash # File that stores the version string -VERSION_FILE=".version" +REPO_DIR=$(dirname $0)/.. +VERSION_FILE="$REPO_DIR/.version" # Function to display help show_help() { echo "Usage: bumpversion.sh [OPTION]" - echo "Modify or display the version string in the form of 'v{major}.{minor}.{build}'." + echo "Modify or display the version string in the form of 'v{major}.{minor}.{patch}'." echo "Stores the version in the file '$VERSION_FILE', defaults to v0.0.0 if it does not exist" echo echo "Options:" - echo " --build Increase the build number by 1." - echo " --minor Increase the minor number by 1 and the build number by 1." - echo " --major Increase the major number by 1, reset minor to 0, and increase build by 1." + echo " --patch Increase the patch number by 1." + echo " --minor Increase the minor number by 1 and reset patch to 0." + echo " --major Increase the major number by 1, reset minor to 0, reset patch to 0." echo " --help Display this help message." echo " (no option) Display the current version." } @@ -34,12 +35,12 @@ set_version() { # Get the current version current_version=$(get_version) -# Extract major, minor, and build numbers +# Extract major, minor, and patch numbers version_pattern='^v([0-9]+)\.([0-9]+)\.([0-9]+)$' if [[ $current_version =~ $version_pattern ]]; then major=${BASH_REMATCH[1]} minor=${BASH_REMATCH[2]} - build=${BASH_REMATCH[3]} + patch=${BASH_REMATCH[3]} else echo "Invalid version format" exit 1 @@ -47,17 +48,17 @@ fi # Handle command-line arguments case "$1" in - --build) - ((build++)) + --patch) + ((patch++)) ;; --minor) ((minor++)) - ((build++)) + patch=0 ;; --major) ((major++)) minor=0 - ((build++)) + patch=0 ;; --help) show_help @@ -71,7 +72,7 @@ case "$1" in esac # Construct the new version string -new_version="v${major}.${minor}.${build}" +new_version="v${major}.${minor}.${patch}" # Update the version file set_version "$new_version" diff --git a/loaders/curl/Dockerfile b/src/loaders/curl/Dockerfile similarity index 100% rename from loaders/curl/Dockerfile rename to src/loaders/curl/Dockerfile diff --git a/loaders/curl/loader.sh b/src/loaders/curl/loader.sh similarity index 100% rename from loaders/curl/loader.sh rename to src/loaders/curl/loader.sh