@spinnaker/kayenta 2.3.0 → 2025.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,93 +0,0 @@
1
- #!/bin/bash
2
- # Usage: assert_package_bumps
3
- # Use [target branch] to change the branch the script checks for changes against
4
- # (default: origin/master if running in a Github Action, master otherwise)
5
-
6
- # Reports if package bumps are combined with other changes (not allowed). Package bumps must be standalone.
7
- if [[ $GITHUB_EVENT_NAME == "pull_request" && ( $GITHUB_BASE_REF != "master" || $GITHUB_REPOSITORY != 'spinnaker/deck-kayenta' ) ]] ; then
8
- echo "This is a pull request, but not to master -- exiting"
9
- exit 0
10
- fi
11
-
12
- cd "$(dirname "$0")" || exit 1;
13
- if [[ -n $GITHUB_ACTIONS ]] ; then
14
- echo "git fetch -q..."
15
- git fetch -q
16
- CI_TARGET_BRANCH=origin/master # dirname should maybe work in both cases?
17
- fi
18
-
19
- # Use the command line argument, origin/master (if running on GHA) or master (in that order)
20
- TARGET_BRANCH=${1}
21
- TARGET_BRANCH=${TARGET_BRANCH:-${CI_TARGET_BRANCH}}
22
- TARGET_BRANCH=${TARGET_BRANCH:-master}
23
- echo "TARGET_BRANCH=$TARGET_BRANCH"
24
- echo ""
25
-
26
- # Run a git diff against TARGET_BRANCH outside of a pipe so it will exit with any failure code
27
- git diff "$TARGET_BRANCH" -- . >/dev/null || exit $?
28
-
29
- # Tests are run against an ephemeral merge commit so we don't have to merge in $TARGET_BRANCH
30
-
31
- HAS_PURE_PKG_BUMP=false
32
-
33
- HAS_PKG_BUMP=$(git diff -U0 "$TARGET_BRANCH" -- "package.json" | grep -c '"version":')
34
- if [ "$HAS_PKG_BUMP" -ne 0 ] ; then
35
- FROM_VERSION=$(git diff "$TARGET_BRANCH" -- "package.json" | grep '^-.*"version":' | sed -e 's/^.*version": "//' -e 's/[",]//g')
36
- TO_VERSION=$(git diff "$TARGET_BRANCH" -- "package.json" | grep '^\+.*"version":' | sed -e 's/^.*": "//' -e 's/[",]//g')
37
-
38
- # Ensuring that the version change is the only change in package.json
39
- PKG_JSON_OTHER_CHANGES=$(git diff --numstat "$TARGET_BRANCH" -- "package.json" | cut -f 1)
40
- if [ "$PKG_JSON_OTHER_CHANGES" -ne 1 ] ; then
41
- echo "==================================================="
42
- echo " Impure package bump"
43
- echo "==================================================="
44
- echo ""
45
- echo "Version change found in package.json"
46
- echo "However, other changes were also found"
47
- echo ""
48
- echo "Version changed from $FROM_VERSION -> $TO_VERSION:"
49
- echo ""
50
- echo "git diff of package.json:"
51
- echo "=========================================="
52
- git diff "$TARGET_BRANCH" -- "package.json" >&2
53
- echo "=========================================="
54
- exit 3
55
- fi
56
-
57
-
58
- # checking that the only file changed is package.json
59
- OTHER_FILES_CHANGED=$(git diff --name-only "$TARGET_BRANCH" | grep -c -v "package.json")
60
- if [ "$OTHER_FILES_CHANGED" -ne 0 ] ; then
61
- echo "==================================================="
62
- echo " Impure package bump"
63
- echo "==================================================="
64
- echo ""
65
- echo "Version change found in package.json"
66
- echo "However, other files were also changed"
67
- echo ""
68
- echo "Version changed from $FROM_VERSION -> $TO_VERSION:"
69
- echo ""
70
- echo "List of all files changed:"
71
- echo "=========================================="
72
- git diff --name-only "$TARGET_BRANCH" >&2
73
- echo "=========================================="
74
- exit 4
75
- fi
76
-
77
-
78
-
79
- HAS_PURE_PKG_BUMP=true
80
- echo "Pure package bump. $FROM_VERSION -> $TO_VERSION"
81
- else
82
- echo "-"
83
- fi
84
-
85
- echo ""
86
- echo ""
87
-
88
- if [[ $HAS_PURE_PKG_BUMP == "true" ]] ; then
89
- [[ "$GITHUB_ACTIONS" == "true" ]] && echo "::set-output name=ispurebump::true"
90
- echo "This is a pure package bump."
91
- else
92
- echo "No packages were bumped."
93
- fi
@@ -1,40 +0,0 @@
1
- #!/bin/bash
2
-
3
- # These scripts are based on similar scripts in https://github.com/spinnaker/deck
4
-
5
- # Check that this is only run by GitHub Actions
6
- echo "Kayenta package publisher ---> Checking that this script is run by GitHub Actions."
7
- if [ "x${GITHUB_ACTIONS}" != "xtrue" ] ; then
8
- echo "This publish script should only be run by GitHub Actions and is not meant to be run locally."
9
- exit 2
10
- fi
11
-
12
- # Check that the last commit modifying package.json contains a version bump ONLY
13
- CWD=$(pwd)
14
- LAST_PKGJSON_COMMIT=$(git log -n 1 --pretty=format:%H -- "package.json")
15
- echo "Kayenta package publisher ---> Checking that the last commit (${LAST_PKGJSON_COMMIT}) contains a version bump ONLY..."
16
- HAS_PKG_BUMP=$(git diff "${LAST_PKGJSON_COMMIT}..${LAST_PKGJSON_COMMIT}~1" -- "package.json" | grep -c '"version"')
17
- if [ "$HAS_PKG_BUMP" -ne 0 ] ; then
18
- echo "Kayenta package publisher ---> Version bump detected. Checking that it is a pure package bump..."
19
- ./build_scripts/assert_package_bump.sh HEAD^ || exit 11
20
- else
21
- echo "Kayenta package publisher ---> The last commit (${LAST_PKGJSON_COMMIT}) did not contain a version bump..."
22
- echo "=========================================="
23
- echo ""
24
- git diff "${LAST_PKGJSON_COMMIT}..${LAST_PKGJSON_COMMIT}~1" -- "package.json"
25
- echo ""
26
- echo "=========================================="
27
- echo "Kayenta package publisher ---> The last commit (${LAST_PKGJSON_COMMIT}) did not contain a version bump. Exiting without publishing."
28
- exit 42
29
- fi
30
- echo "Kayenta package publisher ---> Looks good! Version bump was the only change. Let's get publishing..."
31
-
32
- # Run yarn
33
- echo "Kayenta package publisher ---> Updating to latest dependencies..."
34
- yarn
35
-
36
- # Determine upstream dependencies and proper build order
37
- echo "Kayenta package publisher ---> Preparing to publish..."
38
- npm publish
39
-
40
- exit 0