-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: use versatiledatakit/shared rc-builds for data-pipelines (#…
…2312) ## Why? Linking shared-components to data-pipelines using npm fails to produce a working UI docker image. This is a CI-only issue. ## What? Introduce rc-versions for @versatiledatakit/shared On a successful build of shared, and rc-version is pushed to npm registry The data-pipelines build pulls the latest rc-version when running, instead of linking to the local installation of shared Versioning schema follows semver {major}.{minor}.{patch}-rc.{rc-number} The rc-number is incremented based on the latest rc-number for the pipeline-id. This helps avoid conflicts between different pipelines running builds for shared Regular shared versions are tagged with latest in npm registry Rc versions are tagged with rc, so they don't get pulled accidentally when running npm install ## How was this tested? Ran a build in CI and tested that the docker image starts locally as part of quickstart-vdk by changing the deployment tag https://gitlab.com/vmware-analytics/versatile-data-kit/-/pipelines/909682172 Docker image tag pushed by pipeline `5eb2c00` To check it locally, run quickstart-vdk and edit the deployment to use this tag. <img width="1654" alt="Screenshot 2023-06-26 at 12 17 49" src="https://github.com/vmware/versatile-data-kit/assets/91800778/1cf6ba0c-b899-46f1-8827-abd29c4fcbf9"> ## What kind of change is this? Feature/non-breaking Signed-off-by: Dilyan Marinov <[email protected]>
- Loading branch information
1 parent
019d1f0
commit c3fa77e
Showing
5 changed files
with
60 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash -e | ||
|
||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
# Extracts the latest rc-version for the pipeline id that's passed | ||
if [ $# -eq 0 ] | ||
then | ||
echo "ERROR: No argument for pipeline id supplied" | ||
exit 3 | ||
fi | ||
npm view @versatiledatakit/shared versions --json | grep $1-rc | cut -d \" -f 2 | tail -1 |
17 changes: 17 additions & 0 deletions
17
projects/frontend/cicd/get_next_shared_rc_version_number.sh
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,17 @@ | ||
#!/bin/bash -e | ||
|
||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Extracts the latest rc-version number for the pipeline id that's passed | ||
# and returns the incremented version number | ||
# e.g. if the latest rc-version is 1.3.${pipeline_id}-rc.3, the script will return 4 | ||
if [ $# -eq 0 ] | ||
then | ||
echo "ERROR: No argument for pipeline id supplied" | ||
exit 3 | ||
fi | ||
|
||
out=$(npm view @versatiledatakit/shared versions --json | grep $1-rc | cut -d \" -f 2 | tail -1 | awk -F '.' '{print $4}') | ||
out=$((out+1)) | ||
echo $out |
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