-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
144 additions
and
2 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
MAKEFILES_VERSION=9.3.2 | ||
MAKEFILES_VERSION=9.5.0 | ||
.DEFAULT_GOAL:=dogu-release | ||
|
||
WORKSPACE=/workspace | ||
|
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,6 @@ | ||
# used to create switch the dogu to a prerelease namespace | ||
# e.g. official/usermgmt -> prerelease_official/usermgmt | ||
|
||
.PHONY: prerelease_namespace | ||
prerelease_namespace: | ||
build/make/stagex.sh prerelease_namespace |
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,33 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
prerelease_namespace() { | ||
|
||
# Update version in dogu.json | ||
if [ -f "dogu.json" ]; then | ||
echo "Updating name in dogu.json..." | ||
ORIG_NAME="$(jq -r ".Name" ./dogu.json)" | ||
PRERELEASE_NAME="prerelease_${ORIG_NAME}" | ||
jq ".Name = \"${PRERELEASE_NAME}\"" dogu.json >dogu2.json && mv dogu2.json dogu.json | ||
jq ".Image = \"registry.cloudogu.com/${PRERELEASE_NAME}\"" dogu.json >dogu2.json && mv dogu2.json dogu.json | ||
fi | ||
|
||
# Update version in Dockerfile | ||
if [ -f "Dockerfile" ]; then | ||
echo "Updating version in Dockerfile..." | ||
ORIG_NAME="$(grep -oP "^[ ]*NAME=\"([^\"]*)" Dockerfile | awk -F "\"" '{print $2}')" | ||
PRERELEASE_NAME="prerelease_$( echo -e "$ORIG_NAME" | sed 's/\//\\\//g' )" | ||
sed -i "s/\(^[ ]*NAME=\"\)\([^\"]*\)\(.*$\)/\1${PRERELEASE_NAME}\3/" Dockerfile | ||
fi | ||
|
||
} | ||
|
||
|
||
TYPE="${1}" | ||
|
||
echo ${TYPE} | ||
if [[ "${TYPE}" == "prerelease_namespace" ]];then | ||
prerelease_namespace | ||
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
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
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,48 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
TYPE="${1}" | ||
|
||
update_build_libs() { | ||
echo "Get newest version of ces-build-lib and dogu-build-lib" | ||
update_jenkinsfile | ||
echo "Newest Versions set. Please check your Jenkinsfile" | ||
} | ||
|
||
get_highest_version() { | ||
local target="${1}" | ||
local gitCesBuildLib | ||
# getting tags from ces-build.libs OR dogu-build-libs | ||
gitCesBuildLib="$(git ls-remote --tags --refs https://github.com/cloudogu/${target}-build-lib)" | ||
local highest | ||
# Flagfile for getting results out of while-loop | ||
rm -rf .versions | ||
while IFS= read -r line; do | ||
local version | ||
version="$(awk -F'/tags/' '{ for(i=1;i<=NF;i++) print $i }' <<< $line | tail -n 1 | sed 's/[^0-9\.]*//g')" | ||
if [[ $version == *"."* ]] ; then | ||
echo $version >> ".versions" | ||
fi | ||
done <<< "$gitCesBuildLib" | ||
highest=$(sort .versions | tail -n 1) | ||
rm -rf .versions | ||
echo "${highest}" | ||
} | ||
|
||
# Patch Jenkinsfile | ||
update_jenkinsfile() { | ||
sed -i "s/ces-build-lib@[[:digit:]].[[:digit:]].[[:digit:]]/ces-build-lib@$(get_highest_version ces)/g" Jenkinsfile | ||
sed -i "s/dugu-build-lib@[[:digit:]].[[:digit:]].[[:digit:]]/dogu-build-lib@$(get_highest_version dogu)/g" Jenkinsfile | ||
} | ||
|
||
# switch for script entrypoint | ||
if [[ "${TYPE}" == "buildlibs" ]];then | ||
update_build_libs | ||
else | ||
echo "Unknown target ${TYPE}" | ||
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
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