-
Notifications
You must be signed in to change notification settings - Fork 17
/
createBuildpack.sh
executable file
·43 lines (35 loc) · 1.26 KB
/
createBuildpack.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
#!/bin/bash
# Copyright (c) 2016, TIBCO Software Inc. All rights reserved.
# You may not use this file except in compliance with the license
# terms contained in the TIBCO License.md file provided with this file.
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
echo ">>>>>>>>>> Start time: $(date) <<<<<<<<<<<<"
if [[ $# -lt 1 || $# -gt 3 ]]; then
echo "Usage: ./createBuildpack.sh <path/to/bwce-runtime-2.3.1.zip> <buildpack-Name> <options>"
printf "\t %s \t\t %s \n\t\t\t\t %s \n" "Location of runtime zip (bwce-runtime-<version>.zip)"
printf "\t %s \t\t %s \n\t\t\t\t %s \n" "Buildpack name"
printf "\t %s \t\t\t %s \n" "-test" "Test created buildpack"
exit 1
fi
zipLocation=$1
if [[ "$PWD" == *bwce-buildpack/build* ]]; then
cd ..
fi
mkdir -p resources/cache && cp -i $zipLocation "$_"
if [ -z "$2" ]; then
buildpackName="bwce-buildpack"
else
buildpackName=$2
fi
zip -r build/${buildpackName}.zip bin/ resources/
buildpackLocation=`get_abs_filename build/${buildpackName}.zip`
cd build
if [ "$3" == "-test" ]; then
./uploadBuildpack.sh $buildpackLocation $buildpackName -test
else
./uploadBuildpack.sh $buildpackLocation $buildpackName
fi
echo ">>>>>>>>>> End time: $(date) <<<<<<<<<<<<"