forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for eva_plugins (autowarefoundation#20)
* Add eva_update_vcs_versions.sh Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add test Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Run post common tasks Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Fix test Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
- Loading branch information
1 parent
e59adaf
commit 47c32c6
Showing
4 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$(readlink -f "$(dirname "$0")") | ||
source "$SCRIPT_DIR/common/helper_functions.sh" | ||
|
||
# Override functions | ||
function get_repos_file_path() { | ||
echo "$(git rev-parse --show-toplevel)/eva_plugins.repos" | ||
} | ||
|
||
function get_product_repositories() { | ||
find src/eva -type d -name '\.git' -print0 | xargs -0 -I {} dirname "{}" | ||
} | ||
|
||
# Define functions | ||
function show_usage() { | ||
echo -e | ||
"Usage: create_reference_rc_branches.sh product_version | ||
[-h/--help] [-y/--yes] [--change-reference-repositories] [--push|--delete] | ||
-h/--help: | ||
Show usage and exit. | ||
-y/--yes: | ||
Proceed without confirmation. | ||
--change-reference-repositories: | ||
Whether to create branches/tags in reference repositories. | ||
--push: | ||
Whether to push branches/tags. Please use this option when you can be sure. | ||
--delete: | ||
Whether to delete branches/tags. Please use this option when you mistook something. | ||
product_version: | ||
The version to be used for product rc branches. | ||
The valid pattern is '^v([0-9]+)\.([0-9]+)\.([0-9]+)$'. | ||
Note: Using --push and --delete at the same time may cause unexpected behaviors." | ||
} | ||
|
||
# Parse arguments | ||
source "$SCRIPT_DIR/common/parse_common_args.sh" | ||
product_version="${args[0]}" | ||
|
||
# Check args | ||
if ! is_valid_product_rc_version "$product_version"; then | ||
echo -e "\e[31mPlease input a valid product rc version as the 2nd argument\e[m" | ||
show_usage | ||
exit 1 | ||
fi | ||
|
||
# Run pre common tasks | ||
source "$SCRIPT_DIR/common/pre_common_tasks.sh" | ||
|
||
# Set branch prefix | ||
branch_prefix="rc/" | ||
|
||
# Create branches in product repositories | ||
echo -e "\e[36mCreate branches in product repositories\e[m" | ||
for product_repository in $(get_product_repositories); do | ||
create_branch "$product_repository" "$branch_prefix$product_version" "$flag_push" "$flag_delete" | ||
done | ||
|
||
# Run post common tasks | ||
if [ "$flag_delete" = "" ]; then | ||
source "$SCRIPT_DIR/common/post_common_tasks.sh" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$(readlink -f "$(dirname "$0")") | ||
source "$SCRIPT_DIR/common/helper_functions.sh" | ||
|
||
# Override functions | ||
function get_repos_file_path() { | ||
echo "$(git rev-parse --show-toplevel)/eva_plugins.repos" | ||
} | ||
|
||
function get_product_repositories() { | ||
find src/eva -type d -name '\.git' -print0 | xargs -0 -I {} dirname "{}" | ||
} | ||
|
||
# Define functions | ||
function show_usage() { | ||
echo -e "Usage: create_product_release_tags.sh product_version | ||
[-h/--help] [-y/--yes] [--change-reference-repositories] [--push|--delete] | ||
-h/--help: | ||
Show usage and exit. | ||
-y/--yes: | ||
Proceed without confirmation. | ||
--change-reference-repositories: | ||
Whether to create branches/tags in reference repositories. | ||
--push: | ||
Whether to push branches/tags. Please use this option when you can be sure. | ||
--delete: | ||
Whether to delete branches/tags. Please use this option when you mistook something. | ||
product_version: | ||
The version to be used for product release tags. | ||
The valid pattern is '^v([0-9]+)\.([0-9]+)\.([0-9]+)$'. | ||
Note: Using --push and --delete at the same time may cause unexpected behaviors." | ||
} | ||
|
||
# Parse arguments | ||
source "$SCRIPT_DIR/common/parse_common_args.sh" | ||
product_version="${args[0]}" | ||
|
||
# Check args | ||
if ! is_valid_product_release_version "$product_version"; then | ||
echo -e "\e[31mPlease input a valid product release version as the 2nd argument\e[m" | ||
show_usage | ||
exit 1 | ||
fi | ||
|
||
# Run pre common tasks | ||
source "$SCRIPT_DIR/common/pre_common_tasks.sh" | ||
|
||
# Create tags in product repositories | ||
echo -e "\e[36mCreate tags in product repositories\e[m" | ||
for product_repository in $(get_product_repositories); do | ||
create_tag "$product_repository" "$product_version" "$flag_push" "$flag_delete" | ||
done | ||
|
||
# Run post common tasks | ||
if [ "$flag_delete" = "" ]; then | ||
source "$SCRIPT_DIR/common/post_common_tasks.sh" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$(readlink -f "$(dirname "$0")") | ||
source "$SCRIPT_DIR/common/helper_functions.sh" | ||
|
||
# Override functions | ||
function get_repos_file_path() { | ||
echo "$(git rev-parse --show-toplevel)/eva_plugins.repos" | ||
} | ||
|
||
update_vcs_versions |