-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from feature/improve-deploy-script-build-process
[Feature] Add Build and Skip params for deploy script
- Loading branch information
Showing
13 changed files
with
82 additions
and
47 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 |
---|---|---|
|
@@ -24,5 +24,3 @@ build | |
|
||
$WSK_CLI -i --apihost "$openwhiskApiHost" action update ${ACTION} "$TEMP_DIR/main.zip" --docker "$DOCKER_IMAGE" \ | ||
--auth "$openwhiskApiKey" --param push_notification_trigger "send-push-notification" --param db_url "http://admin:p@[email protected]:5984" --param db_name "balance_filter_db" -a provide-api-key true | ||
|
||
clear_temp |
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 |
---|---|---|
|
@@ -24,5 +24,3 @@ build | |
|
||
$WSK_CLI -i --apihost "$openwhiskApiHost" action update ${ACTION} "$TEMP_DIR/main.zip" --docker "$DOCKER_IMAGE" \ | ||
--auth "$openwhiskApiKey" --param event_registration_db "event_registration_db" --param balance_filter_db "balance_filter_db" --param db_name "balance_notification_registration_db" --param db_url "http://admin:p@[email protected]:5984" --web true | ||
|
||
clear_temp |
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 |
---|---|---|
|
@@ -24,5 +24,3 @@ build | |
|
||
$WSK_CLI -i --apihost "$openwhiskApiHost" action update ${ACTION} "$TEMP_DIR/main.zip" --docker "$DOCKER_IMAGE" \ | ||
--auth "$openwhiskApiKey" --param db_name "event_registration_db" --param db_url "http://admin:p@[email protected]:5984" --param feed "kafka-provider-feed" --param brokers "[\"172.17.0.1:9092\"]" -a provide-api-key true | ||
|
||
clear_temp |
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 |
---|---|---|
|
@@ -24,5 +24,3 @@ build | |
|
||
$WSK_CLI -i --apihost "$openwhiskApiHost" action update ${ACTION} "$TEMP_DIR/main.zip" --kind nodejs:default \ | ||
--auth "$openwhiskApiKey" --param endpoint "http://172.17.0.1:8888" --param db_url "http://admin:p@[email protected]:5984" --param db_name "ow_kafka_triggers" -a provide-api-key true --web true | ||
|
||
clear_temp |
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
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
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
if [ -e $TEMP_DIR ]; then | ||
echo "Clearing previously packed action files." | ||
rm -rf $TEMP_DIR | ||
if [ "$build" = true ]; then | ||
if [ -e $TEMP_DIR ]; then | ||
echo "Clearing previously packed action files." | ||
rm -rf $TEMP_DIR | ||
fi | ||
|
||
mkdir -p $TEMP_DIR | ||
echo "Creating temporary directory" | ||
|
||
echo "Copying files to temporary directory" | ||
cp -r "$SRC_DIR/package.json" "$SRC_DIR/lib" "$SRC_DIR/main.js" $TEMP_DIR | ||
|
||
cd $TEMP_DIR | ||
|
||
yarn install --production=true | ||
|
||
zip -r "$TEMP_DIR/main.zip" * | ||
fi | ||
|
||
mkdir -p $TEMP_DIR | ||
echo "Creating temporary directory" | ||
|
||
echo "Copying files to temporary directory" | ||
cp -r "$SRC_DIR/package.json" "$SRC_DIR/lib" "$SRC_DIR/main.js" $TEMP_DIR | ||
|
||
cd $TEMP_DIR | ||
|
||
yarn install --production=true | ||
|
||
zip -r "$TEMP_DIR/main.zip" * |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
DOCKER_IMAGE="hugobyte/openwhisk-runtime-rust:v0.2" | ||
|
||
if [ -e $TEMP_DIR ]; then | ||
echo "Clearing previously packed action files." | ||
rm -rf $TEMP_DIR | ||
if [ "$build" = true ]; then | ||
if [ -e $TEMP_DIR ]; then | ||
echo "Clearing previously packed action files." | ||
rm -rf $TEMP_DIR | ||
fi | ||
|
||
mkdir -p $TEMP_DIR | ||
echo "Creating temporary directory" | ||
|
||
echo "Building Source to $TEMP_DIR/main.zip" | ||
|
||
cd $SRC_DIR | ||
|
||
zip -r - Cargo.toml src | docker run -e RELEASE=true -i --rm $DOCKER_IMAGE -compile main > "$TEMP_DIR/main.zip" | ||
fi | ||
|
||
mkdir -p $TEMP_DIR | ||
echo "Creating temporary directory" | ||
|
||
echo "Building Source to $TEMP_DIR/main.zip" | ||
|
||
cd $SRC_DIR | ||
|
||
zip -r - Cargo.toml src | docker run -e RELEASE=true -i --rm $DOCKER_IMAGE -compile main > "$TEMP_DIR/main.zip" | ||
|
||
cd $TEMP_DIR |
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,11 @@ | ||
array_contains () { | ||
local seeking=$1; shift | ||
local in=1 | ||
for element; do | ||
if [[ $element == "$seeking" ]]; then | ||
in=0 | ||
break | ||
fi | ||
done | ||
return $in | ||
} |