forked from watson-developer-cloud/discovery-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·39 lines (29 loc) · 887 Bytes
/
deploy.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
#!/bin/bash
#set -x
#CF_TRACE=true
# Compute a unique app name using the reserved CF_APP name (configured in the
# deployer or from the manifest.yml file) and the build number
export TEMP_APP_NAME="discovery-news-demo-crawl-date"
# write out manifest.yml
echo "Writing manifest.yml..."
cat > ./manifest.yml <<EOL
name: ${TEMP_APP_NAME}
instances: 1
memory: 512M
command: npm start
services:
- Discovery-Demo
env:
DEMO_DEPLOY: 1
EOL
echo "Manifest file written"
cat ./manifest.yml
echo "Pushing new app:$TEMP_APP_NAME"
cf push $TEMP_APP_NAME
export TEMP_APP_URL="https://${TEMP_APP_NAME}.${ROUTE_DOMAIN}"
echo "##############################################################"
echo "Deployed new app $TEMP_APP_NAME"
echo "on temporary route: $TEMP_APP_URL"
echo "##############################################################"
# View logs
#cf logs "${TEMP_APP_NAME}" --recent