forked from dtcenter/METplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature 651 version set in one place (dtcenter#663)
* added __version__ to metplus that reads from docs/version * read version file, use 'latest' tag of MET Docker image for released versions, i.e. v4.0, use 'develop' tag of MET Docker image for all others, i.e. feature branches, beta releases, etc. * read version, use release version of data volume from dtcenter/metplus-data if testing a release, i.e. main_vX.Y, otherwise use metplus-data-dev * fixed call to dirname * Update conf.py * [ci-skip] changed version to major release to test docker build hook changes * removed v from version check because version file does not include v at the beginning * changed version back -- setting version to 4.0 successfully used 'latest' for MET image tag * print version number to screen before anything else is done in master_metplus * set met version to X+6.Y for maj/min release, changed version to test [ci-skip] * put met version computation into a script that is called by the build hooks file, changed version file back * removed commented line that should not be needed * remove duplicate tag that was commented out * fixed call to get_met_version in build hooks file * Removed accidentally commented line * Made comment more clear [ci-skip] * Fixed typo in comment * use develop as version in docs if not a major/minor/bugfix release * Update ci/travis_jobs/get_data_volumes.py Yes, this makes sense. The docker data volumes DO NOT change for bugfix versions. So we should look for docker data volumes tagged as vX.Y, not vX.Y.Z Co-authored-by: George McCabe <[email protected]> * Update ci/docker/hooks/get_met_version Accepting suggestion to switch the MET DockerHub tag from $major"."$minor to $major"."$minor"-latest" Co-authored-by: johnhg <[email protected]>
- Loading branch information
1 parent
883ab0d
commit 80c54c5
Showing
8 changed files
with
71 additions
and
26 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#!/bin/bash | ||
|
||
docker build -t $IMAGE_NAME --build-arg SOURCE_BRANCH=$SOURCE_BRANCH --build-arg MET_BRANCH=develop --build-arg DO_GIT_CLONE=true . | ||
# get version, use develop or X+6.Y for MET_BRANCH | ||
met_branch=`$(dirname $DOCKERFILE_PATH)/hooks/get_met_version` | ||
|
||
echo $met_branch | ||
docker build -t $IMAGE_NAME --build-arg SOURCE_BRANCH=$SOURCE_BRANCH --build-arg MET_BRANCH=$met_branch --build-arg DO_GIT_CLONE=true . |
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 @@ | ||
#!/bin/bash | ||
|
||
# get version, use develop or X+6.Y for MET_BRANCH | ||
version_file=$(dirname $DOCKERFILE_PATH)/../../docs/version | ||
|
||
if cat $version_file | egrep -q '[0-9.]+$'; then | ||
let major=$(cut -d '.' -f1 $version_file)+6 | ||
minor=$(cut -d '.' -f2 $version_file ) | ||
met_branch=$major"."$minor"-latest" | ||
else | ||
met_branch=develop | ||
fi | ||
|
||
echo $met_branch |
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,12 @@ | ||
import os | ||
|
||
def get_metplus_version(): | ||
version_file = os.path.abspath(os.path.join(os.path.dirname(__file__), | ||
os.pardir, | ||
'docs', | ||
'version')) | ||
with open(version_file, 'r') as file_handle: | ||
version = file_handle.read().strip() | ||
return version | ||
|
||
__version__ = get_metplus_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
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