Skip to content

Commit

Permalink
Merge pull request #389 from bci-oss/add_release_script
Browse files Browse the repository at this point in the history
Add initial version of release script
  • Loading branch information
bs-jokri authored Oct 6, 2023
2 parents aa1b3f1 + 7b76d0c commit 10c40a5
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
#######################################################################
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This work is made available under the terms of the
# Creative Commons Attribution 4.0 International (CC-BY-4.0) license,
# which is available at
# https://creativecommons.org/licenses/by/4.0/legalcode.
#
# SPDX-License-Identifier: CC-BY-4.0
#######################################################################


# REMARKS:
# ========
# This script create release notes for a given period. Be advised that the script manipulates the currrent state of your local git repository.
# i.e. it switches branches, checks out specific commits and assumes you are on main. So please make sure you have not uncommitted change and
# that you are on main.

# Usage:
# ./release.sh '10/01/2022' '12/15/2022'

HEADLINES=("Added" "Deprecated" "Standardized")
STATUS=("release" "deprecate" "standardize")

for str in ${myArray[@]}; do
echo $str
done

for i in ${!HEADLINES[@]}; do
printf "\n## ${HEADLINES[$i]}\n"
git checkout `git rev-list -n 1 --before="$2" main` >/dev/null 2>&1
git whatchanged --since $1 --until $2 --pretty=format: --name-only | grep '\metadata.json$'| xargs grep -l "${STATUS[$i]}" | sed -e "s/\metadata.json$//"
git checkout main >/dev/null 2>&1
done


printf "\n## Removed\n"
git whatchanged --since $1 --until $2 --diff-filter D --pretty="format:" --name-only | grep '\metadata.json$'| sed '/^$/d'| grep '\metadata.json$'

printf "\n--------------------------------\n"

0 comments on commit 10c40a5

Please sign in to comment.