fix: correct issues with python3 no longer being available by default
This commit is contained in:
4 files changed
+28
-3
No files matched your search
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"healthchecks": {
|
||||||
|
"web": [
|
||||||
|
{
|
||||||
|
"attempts": 2,
|
||||||
|
"content": "python/http.server",
|
||||||
|
"name": "check-1",
|
||||||
|
"path": "/",
|
||||||
|
"timeout": 5,
|
||||||
|
"type": "startup",
|
||||||
|
"wait": 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dokku": {
|
||||||
|
"postdeploy": "touch /workspace/postdeploy.test",
|
||||||
|
"predeploy": "touch /workspace/predeploy.test"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ uri = "./cnb/1"
|
|||||||
[[build.buildpacks]]
|
[[build.buildpacks]]
|
||||||
uri = "./cnb/1"
|
uri = "./cnb/1"
|
||||||
|
|
||||||
|
[[build.buildpacks]]
|
||||||
|
uri = "gcr.io/paketo-buildpacks/python"
|
||||||
|
|
||||||
[[order.group]]
|
[[order.group]]
|
||||||
uri = "gcr.io/paketo-buildpacks/procfile"
|
uri = "gcr.io/paketo-buildpacks/procfile"
|
||||||
@@ -5,7 +5,8 @@ import os
|
|||||||
def main():
|
def main():
|
||||||
print("GLOBAL_SECRET: {0}".format(os.getenv('GLOBAL_SECRET')))
|
print("GLOBAL_SECRET: {0}".format(os.getenv('GLOBAL_SECRET')))
|
||||||
print("SECRET_KEY: {0}".format(os.getenv('SECRET_KEY')))
|
print("SECRET_KEY: {0}".format(os.getenv('SECRET_KEY')))
|
||||||
with open("/app/.env", "r") as f:
|
app_dir = os.getcwd()
|
||||||
|
with open(f"{app_dir}/.env", "r") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
if "DOTENV_KEY" in line:
|
if "DOTENV_KEY" in line:
|
||||||
print(line)
|
print(line)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP inject_requirements_txt
|
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP initialize_for_cnb
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
@@ -81,9 +81,10 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
inject_requirements_txt() {
|
initialize_for_cnb() {
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
local APP_REPO_DIR="$2"
|
local APP_REPO_DIR="$2"
|
||||||
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
[[ -z "$APP" ]] && local APP="$TEST_APP"
|
||||||
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
|
echo "flask" >>"$APP_REPO_DIR/requirements.txt"
|
||||||
|
mv "$APP_REPO_DIR/app-cnb.json" "$APP_REPO_DIR/app.json"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user