-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable auto vendoring of MCM dependency (#41)
- Loading branch information
1 parent
6849298
commit 710ce17
Showing
4 changed files
with
85 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
if [ -z "${MAIN_REPO_DIR:-}" ]; then | ||
export MAIN_REPO_DIR="$(readlink -f "$(dirname "${0}")/..")" | ||
fi | ||
MCM_VERSION_FILEPATH="${MAIN_REPO_DIR}/MCM_VERSION" | ||
|
||
export VERSION="$(cat "${MCM_VERSION_FILEPATH}")" | ||
|
||
${ADD_DEPENDENCIES_CMD} \ | ||
--component-dependencies "{\"name\":\"github.com/gardener/machine-controller-manager\",\"version\":\"$VERSION\"}" | ||
|
||
mv "${BASE_DEFINITION_PATH}" "${COMPONENT_DESCRIPTOR_PATH}" |
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,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
if [ -z "${MAIN_REPO_DIR:-}" ]; then | ||
export MAIN_REPO_DIR="$(readlink -f "$(dirname "${0}")/..")" | ||
fi | ||
|
||
echo "repo-dir: ${MAIN_REPO_DIR}" | ||
|
||
if [ "${DEPENDENCY_NAME}" != "github.com/gardener/machine-controller-manager" ]; then | ||
echo "error: do not know how to upgrade ${DEPENDENCY_NAME}" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${DEPENDENCY_VERSION:-}" ]; then | ||
echo "env var DEPENDENCY_VERSION must be set" | ||
exit 1 | ||
fi | ||
|
||
# for now, we only know how to upgrade github.com/gardener/machine-controller-manager, as checked above | ||
|
||
MCM_FILEPATH="${MAIN_REPO_DIR}/MCM_VERSION" | ||
|
||
if [ ! -f "${MCM_FILEPATH}" ]; then | ||
echo "error: no such file: {MCM_FILEPATH}" | ||
exit 1 | ||
fi | ||
|
||
echo -n "${DEPENDENCY_VERSION}" > "${MCM_FILEPATH}" | ||
echo "set dependency-version of ${DEPENDENCY_NAME} to ${DEPENDENCY_VERSION}" | ||
|
||
cd ${MAIN_REPO_DIR} | ||
old_version=$(cat go.mod | grep "github.com/gardener/machine-controller-manager v" | xargs) | ||
new_version="github.com/gardener/machine-controller-manager ${DEPENDENCY_VERSION}" | ||
sed -i -- 's#'"${old_version}"'#'"${new_version}"'#g' go.mod | ||
|
||
#apk add --no-cache go make | ||
|
||
make revendor |
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 @@ | ||
v0.48.1 |