Skip to content

Commit

Permalink
Add 'update application-table'
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
  • Loading branch information
jonseymour committed Jul 29, 2015
1 parent 3a9cf9d commit d205717
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,19 @@ You can generate the correct entry with:
* "Your application’s callback URL; Read our OAuth documentation for more info." - https://apiservice.example.com/auth/ninja/callback
* "This text is displayed to all potential users of your application." - "This is a private Ninja Cloud"

After saving, take note of the "Client ID" and "Secret" under the "Application Details" title as you will need to
edit services-docker-compose.yml to have these values.
After saving, take note of the "Client ID" and "Secret" under the "Application Details" title.

* Enable some flags for the REST API service application
* Update the NINJA_APP_TOKEN and NINJA_APP_KEY variables with the values collected from the last step

```
docker exec -it spherestack_spheremysql_1 mysql douitsu -uroot;
update application set is_ninja_official=1 where appid = '<app id for this application>';
./sphere-stack.sh edit
```

* Update the following environment variables for this application in config/apiservice:
* Enable some flags for the REST API service application

* usvc_oauth_callbackURL=https://apiservice.example.com/auth/ninja/callback
* usvc_oauth_authorizationURL=https://douitsu.example.com/dialog/authorize
* usvc_oauth_clientID=app_XX
* usvc_oauth_clientSecret=sk_XX
```
./sphere-stack.sh update application-table
```

* Recreate the services composition
```
Expand Down
11 changes: 10 additions & 1 deletion sphere-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ edit() {
create config
}

update() {
application-table() {
docker exec -i spherestack_spheremysql_1 mysql douitsu -uroot <<EOF
update application set is_ninja_official=1 where appid = '${NINJA_APP_TOKEN}';
EOF
}
"$@"
}

init() {
mkdir -p .sphere-stack
chmod 0700 .sphere-stack
Expand Down Expand Up @@ -216,7 +225,7 @@ case $cmd in
init|version)
$cmd "$@"
;;
create|ip|domain|hosts-append|machine|start|stop|logs|recreate|init|edit)
create|ip|domain|hosts-append|machine|start|stop|logs|recreate|init|edit|update)
test -f .sphere-stack/master || die "run ./sphere-stack.sh init first!"
. .sphere-stack/master
$cmd "$@"
Expand Down

0 comments on commit d205717

Please sign in to comment.