Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 1b7a605

Browse files
authored
Merge pull request #38 from IBM/add_deploy_to_bluemix
Update pipeline commands.
2 parents 35b8e02 + eac0690 commit 1b7a605

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

‎.bluemix/pipeline.yml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@ stages:
5252
./wsk package refresh
5353
5454
set +e
55-
pwd
56-
ls -Flat
55+
56+
echo "Creating a clean deployment"
57+
wsk rule disable echo-images
58+
sleep 1
59+
wsk rule delete echo-images
60+
wsk trigger delete image-uploaded
61+
wsk action delete write-to-cloudant
62+
wsk action delete write-from-cloudant
63+
wsk action delete write-from-cloudant-sequence
64+
wsk package delete "$CLOUDANT_INSTANCE"
65+
sleep 1
5766
5867
echo "Binding package"
5968
./wsk package bind /whisk.system/cloudant "$CLOUDANT_INSTANCE" \
@@ -62,29 +71,24 @@ stages:
6271
--param host "$CLOUDANT_USERNAME.cloudant.com"
6372
6473
echo "Creating write-from-cloudant ..."
65-
./wsk action get -s write-from-cloudant || \
6674
./wsk action create write-from-cloudant actions/write-from-cloudant.js
6775
6876
echo "Creating write-from-cloudant ..."
69-
./wsk action get -s write-to-cloudant || \
7077
./wsk action create write-to-cloudant actions/write-to-cloudant.js \
7178
--param CLOUDANT_USERNAME "$CLOUDANT_USERNAME" \
7279
--param CLOUDANT_PASSWORD "$CLOUDANT_PASSWORD" \
7380
--param CLOUDANT_DATABASE "$CLOUDANT_DATABASE"
7481
7582
echo "Creating write-from-cloudant-sequence ..."
76-
./wsk action get -s write-from-cloudant-sequence || \
7783
./wsk action update write-from-cloudant-sequence \
7884
--sequence /_/$CLOUDANT_INSTANCE/read,write-from-cloudant
7985
8086
echo "Creating trigger image-uploaded for feed $CLOUDANT_INSTANCE/changes on db $CLOUDANT_DATABASE ..."
81-
./wsk trigger get -s image-uploaded || \
8287
./wsk trigger create image-uploaded \
8388
--feed "/_/$CLOUDANT_INSTANCE/changes" \
8489
--param dbname "$CLOUDANT_DATABASE"
8590
8691
echo "Creating rule echo-images on image-uploaded ..."
87-
./wsk rule get -s echo-images || \
8892
./wsk rule create echo-images image-uploaded write-from-cloudant-sequence
8993
9094
hooks:

‎.bluemix/toolchain.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ deploy:
4545
deploy-space: "{{space}}"
4646
openwhisk-api-endpoint: "openwhisk.ng.bluemix.net"
4747
openwhisk-auth-key: ""
48-
cloudant-instance: ""
48+
cloudant-instance: "openwhisk-cloudant"
4949
cloudant-username: ""
5050
cloudant-password: ""
51-
cloudant-database: ""
51+
cloudant-database: "cats"

‎actions/write-from-cloudant.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* This action is fired in response to new data in the Cloudant database.
20-
* It echos the data to the console.
20+
* It echos the data received about the change to the console.
2121
*/
2222
function main(params) {
2323
console.log('[write-from-cloudant.main] Writing database changes to console');

‎actions/write-to-cloudant.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function main(params) {
6464
imageName,
6565
function(err, body) {
6666
if (err && err.statusCode != 409) {
67-
console.log("Error with file insert.");
67+
console.log("Error with file insert."+err);
6868
reject();
6969
} else {
7070
console.log("Success with file insert.");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /