[config] test python buildpack too
This commit is contained in:
1 parent
c20fbfccf6
commit
12c9536a7b
3 files changed
+35
-2
No files matched your search
@@ -1,2 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "python/flask"
|
set -e;
|
||||||
|
base_url=$1
|
||||||
|
test_url () {
|
||||||
|
path="$1"
|
||||||
|
expected_output="$2"
|
||||||
|
url="${base_url}${path}"
|
||||||
|
output="$(curl -s -S "$url")"
|
||||||
|
echo "$url -> $output"
|
||||||
|
test "$output" == "$expected_output"
|
||||||
|
}
|
||||||
|
|
||||||
|
base_url="$1"
|
||||||
|
test_url / "python/flask"
|
||||||
|
test_url /HELLO "Hello
|
||||||
|
'world' "
|
||||||
@@ -1,8 +1,18 @@
|
|||||||
import os
|
import os
|
||||||
from flask import Flask
|
from flask import Flask, abort
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def hello():
|
def hello():
|
||||||
return 'python/flask'
|
return 'python/flask'
|
||||||
|
|
||||||
|
@app.route('/<env>')
|
||||||
|
def get_enc(env):
|
||||||
|
val = os.environ.get(env, None)
|
||||||
|
if val:
|
||||||
|
return val
|
||||||
|
else:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
|
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ex;
|
||||||
|
|
||||||
|
REMOTE=$1
|
||||||
|
REPO=$2
|
||||||
|
|
||||||
|
GREETING=$(printf "Hello
|
||||||
|
'world' " | base64)
|
||||||
|
ssh "$REMOTE" config:set --encoded "$REPO" HELLO="$GREETING"
|
||||||
Reference in new issue
Block a user