forked from spring-cloud/spring-cloud-dataflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-carvel-package.sh
executable file
·72 lines (64 loc) · 2.48 KB
/
create-carvel-package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
SCDIR=$(realpath $SCDIR)
if [ "$SCDF_TYPE" = "" ]; then
export SCDF_TYPE=oss
fi
if [ "$TARGET_DIR" != "" ]; then
pushd $TARGET_DIR
fi
if [ "$VERSION" = "" ]; then
export VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
fi
if [ "$DATAFLOW_VERSION" = "" ]; then
export DATAFLOW_VERSION=$VERSION
fi
if [ "$PACKAGE_VERSION" = "" ]; then
export PACKAGE_VERSION=$DATAFLOW_VERSION
fi
if [ "$SKIPPER_VERSION" = "" ]; then
export SKIPPER_VERSION=$(./mvnw help:evaluate -Dexpression=spring-cloud-skipper.version -pl spring-cloud-dataflow-parent -q -DforceStdout)
fi
if [ "$TARGET_DIR" != "" ]; then
popd
fi
export SERVER_VERSION=$DATAFLOW_VERSION
if [ "$SCDF_TYPE" = "pro" ]; then
export SERVER_REPOSITORY="dev.registry.pivotal.io/p-scdf-for-kubernetes/scdf-pro-server"
else
export SERVER_REPOSITORY="springcloud/spring-cloud-dataflow-server"
fi
export CTR_VERSION=$DATAFLOW_VERSION
export PACKAGE_NAME=scdf
export PACKAGE_BUNDLE_TEMPLATE="src/carvel/templates/bundle/package"
export VENDIR_SRC_IN="src/carvel/config"
export IMGPKG_LOCK_TEMPLATE="src/carvel/templates/imgpkg"
echo "Project Version=$PACKAGE_VERSION"
echo "Data Flow Version=$DATAFLOW_VERSION"
echo "Skipper Version=$SKIPPER_VERSION"
echo "Build Type=$SCDF_TYPE"
pushd src/carvel || exit
npm install
npm ci
npm run format-check
popd || exit
source "$SCDIR/.github/actions/build-package-bundle/build-package-bundle.sh"
if [ "$1" != "no-push" ]; then
if [ "$REGISTRY" = "" ]; then
REGISTRY=springcloud
fi
echo "Bundle path:$PACKAGE_BUNDLE_GENERATED"
REPOSITORY="$REGISTRY/scdf-$SCDF_TYPE-package"
imgpkg push --bundle "$REPOSITORY:$PACKAGE_VERSION" --file "$PACKAGE_BUNDLE_GENERATED" --registry-username "$DOCKER_HUB_USERNAME" --registry-password "$DOCKER_HUB_PASSWORD"
docker pull "$REPOSITORY:$PACKAGE_VERSION"
export REPO_BUNDLE_TEMPLATE="src/carvel/templates/bundle/repo"
if [ "$PACKAGE_BUNDLE_REPOSITORY" = "" ]; then
export PACKAGE_BUNDLE_REPOSITORY="$REPOSITORY"
fi
source "$SCDIR/.github/actions/build-repository-bundle/build-repository-bundle.sh"
echo "Repository path: $REPO_BUNDLE_GENERATED"
REPOSITORY="$REGISTRY/scdf-$SCDF_TYPE-repo"
imgpkg push --bundle "$REPOSITORY:$PACKAGE_VERSION" --file "$REPO_BUNDLE_GENERATED" --registry-username "$DOCKER_HUB_USERNAME" --registry-password "$DOCKER_HUB_PASSWORD"
docker pull "$REPOSITORY:$PACKAGE_VERSION"
fi
exit $?