Skip to content

Commit

Permalink
add env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Reynolds committed Apr 28, 2024
1 parent 4d4be8d commit 66e52ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions labapp/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
from ce import get_ce_info, get_ce_state

app = Flask(__name__)
app.config['site'] = os.getenv('SITE', None)
app.config['udf'] = os.getenv('UDF', False)
info = None
if app.config['site']:
if app.config['udf']:
info = get_ce_info()
app.config['ce_info'] = info
app.config['ce_info'] = None
app.config['base_url'] = "lab-mcn.f5demos.com"
app.config['CACHE_TYPE'] = 'SimpleCache'
cache = Cache(app)
Expand Down Expand Up @@ -61,7 +60,7 @@ def setup():
return response
return render_template('setup.html', base_url=app.config['base_url'])

@app.route('/ce_state')
@app.route('/_ce_state')
@cache.cached(timeout=30)
def ce_state():
data = get_ce_state(app.config['ce_info'])
Expand Down
2 changes: 1 addition & 1 deletion labapp/service_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Restart=always
ExecStartPre=-/usr/bin/docker stop $IMAGE
ExecStartPre=-/usr/bin/docker rm $IMAGE
ExecStartPre=/usr/bin/docker pull $IMAGE
ExecStart=/usr/bin/docker run -p 1337:5000 --rm --name $CONTAINER $IMAGE
ExecStart=/usr/bin/docker run -p 1337:5000 -e UDF="True" --rm --name $CONTAINER $IMAGE
ExecStop=/usr/bin/docker stop $CONTAINER
[Install]
Expand Down

0 comments on commit 66e52ce

Please sign in to comment.