-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update cf script, validate table existence before creation, log level…
… env var
- Loading branch information
Grant Moore
committed
Feb 5, 2022
1 parent
37de1d6
commit 8fdb654
Showing
9 changed files
with
98 additions
and
14 deletions.
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
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
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
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,58 @@ | ||
import os | ||
import sys | ||
|
||
MAJOR = 0 | ||
MINOR = 1 | ||
MICRO = 2 | ||
|
||
app_dir = os.path.dirname(os.path.realpath(__file__)) | ||
project_dir = os.path.dirname(os.path.dirname(app_dir)) | ||
version_file = os.path.join(project_dir, 'version.txt') | ||
|
||
|
||
def load_current_version(): | ||
with open(version_file, 'r') as f: | ||
ver = f.read() | ||
return ver | ||
|
||
|
||
def save_new_version(version_str): | ||
with open(version_file, 'w') as f: | ||
f.write(version_str) | ||
|
||
|
||
def to_version_array(version_string): | ||
version_array = version_string.split('.') | ||
return [int(x) for x in version_array] | ||
|
||
|
||
def to_version_string(version_array): | ||
version_string_array = [str(x) for x in version_array] | ||
return '.'.join(version_string_array) | ||
|
||
|
||
def iterate_index(version_string, version_index): | ||
version_array = to_version_array(version_string) | ||
version_array[version_index] += 1 | ||
return to_version_string(version_array) | ||
|
||
|
||
def reset_index(version_string, version_index): | ||
version_array = to_version_array(version_string) | ||
version_array[version_index] = 0 | ||
return to_version_string(version) | ||
|
||
|
||
if __name__ == "__main__": | ||
version = load_current_version() | ||
parsed_args = [str(x).lower() for x in sys.argv] | ||
if 'major' in parsed_args: | ||
version = iterate_index(version, MAJOR) | ||
version = reset_index(version, MINOR) | ||
version = reset_index(version, MICRO) | ||
if 'minor' in parsed_args: | ||
version = iterate_index(version, MINOR) | ||
version = reset_index(version, MICRO) | ||
if 'micro' in parsed_args: | ||
version = iterate_index(version, MICRO) | ||
save_new_version(version) |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
amazon.ion==0.9.1 | ||
boto3==1.20.49 | ||
pyqldb==3.2.2 | ||
python-dotenv==0.19.2 | ||
pytest==7.0.0 | ||
|
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