Skip to content

Commit ed04898

Browse files
Fix grep logic
1 parent 2951cc5 commit ed04898

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

serverless/release.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ fi
1414

1515
cd serverless
1616
# Extract current version from the template so that we can replace it with the new version
17-
CURRENT_VERSION=$(grep -o 'Version: \d\+\.\d\+\.\d\+' template.yml | cut -d' ' -f2)
18-
echo "Debug Start"
19-
pwd
20-
GREP_VER=$(grep -o 'Version: \d\+\.\d\+\.\d\+' template.yml)
21-
echo "GREP_VER: $GREP_VER"
22-
CUT_VER=$(echo $GREP_VER | cut -d' ' -f2)
23-
echo "CUT_VER: $CUT_VER"
24-
grep --version
25-
cut --version
17+
CURRENT_VERSION=$(grep -o 'Version: [0-9]\+\.[0-9]\+\.[0-9]\+' template.yml | cut -d' ' -f2)
2618

2719
# If current version is empty, exit
2820
if [ -z "$CURRENT_VERSION" ]; then
@@ -56,7 +48,7 @@ echo "$CI_PIPELINE_SOURCE"
5648

5749
if [ "$PROD_RELEASE" = true ] ; then
5850
if [ -z "$CI_COMMIT_TAG" ]; then
59-
printf "[Error] No CI_COMMIT_TAG found.\n"
51+
printf "[Error] No CI_COMMIT_TAG found. Create a new tag for this prod release in Repo first!\n"
6052
printf "Exiting script...\n"
6153
exit 1
6254
else
@@ -73,7 +65,6 @@ if [ "$PROD_RELEASE" = true ] ; then
7365
echo "Setting origin to github.com/DataDog/datadog-cloudformation-macro.git"
7466
git remote set-url origin https://github.com/DataDog/datadog-cloudformation-macro.git
7567

76-
# alias gh="env -u GITHUB_TOKEN gh $1"
7768
echo "Checking git auth status"
7869
gh auth status
7970

0 commit comments

Comments
 (0)