-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added production parameter recognition feature (#468)
- Loading branch information
Murat Ursavas
committed
Jan 27, 2023
1 parent
4b0e204
commit d90a89d
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ignored: | ||
- DL3059 | ||
- SC1091 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
freq_file_name="/var/nebra/envvars/FREQ" | ||
variant_file_name="/var/nebra/envvars/VARIANT" | ||
|
||
# Create necessary folder if it doesn't exist | ||
if [ ! -d "/var/nebra/envvars" ]; then | ||
mkdir "/var/nebra/envvars" | ||
fi | ||
|
||
#FREQ | ||
if [ -z ${FREQ+x} ]; then | ||
if [ -f ${freq_file_name} ]; then | ||
FREQ=$(<${freq_file_name}); | ||
export FREQ=${FREQ} | ||
echo "FREQ is set as ${FREQ}"; | ||
else | ||
echo "Error: Cannot set FREQ variable."; | ||
fi | ||
else | ||
echo "FREQ variable is already set as ${FREQ}."; | ||
if [ ! -f ${freq_file_name} ]; then | ||
echo "FREQ parameter file doesn't exist. Setting it as ${FREQ} now."; | ||
echo "${FREQ}" > ${freq_file_name} | ||
fi | ||
fi | ||
|
||
#VARIANT | ||
if [ -z ${VARIANT+x} ]; then | ||
if [ -f ${variant_file_name} ]; then | ||
VARIANT=$(<${variant_file_name}); | ||
export VARIANT=${VARIANT} | ||
echo "VARIANT is set as ${VARIANT}"; | ||
else | ||
echo "Error: Cannot set VARIANT variable."; | ||
fi | ||
else | ||
echo "VARIANT variable is already set as ${VARIANT}."; | ||
if [ ! -f ${variant_file_name} ]; then | ||
echo "VARIANT parameter file doesn't exist. Setting it as ${VARIANT} now."; | ||
echo "${VARIANT}" > ${variant_file_name} | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/sh | ||
|
||
# shellcheck source=/dev/null | ||
. /var/nebra/setenv.sh | ||
|
||
gunicorn --bind 0.0.0.0:5000 --timeout 300 hw_diag.wsgi:wsgi_app |