-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autogenerate useful tags for various built images
- Loading branch information
Showing
3 changed files
with
123 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
import subprocess | ||
import sys | ||
from datetime import date | ||
|
||
# Today's date should be a tag | ||
print(date.today().isoformat()) | ||
|
||
# Python version inside should be a tag | ||
python_version_string = f"{sys.version_info.major}.{sys.version_info.minor}" | ||
print(f"python-{python_version_string}") | ||
|
||
# Ubuntu version should be a tag | ||
ubuntu_version = ( | ||
subprocess.check_output( | ||
["/bin/bash", "-c", "source /etc/os-release; echo $VERSION_ID"] | ||
) | ||
.decode() | ||
.strip() | ||
) | ||
print(f"ubuntu-{ubuntu_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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python | ||
import json | ||
import subprocess | ||
|
||
# Ubuntu version should be a tag | ||
qgis_version = json.loads( | ||
subprocess.check_output(["mamba", "list", "qgis", "--json"]).decode().strip() | ||
)[0]['version'] | ||
|
||
|
||
print(f"qgis-{qgis_version}") | ||
# Provide a shortened, major.minor version too | ||
shortened_version = '.'.join(qgis_version.split('.')[0:2]) | ||
print(f"qgis-{shortened_version}") |