Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
3e8fa043
Commit
3e8fa043
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[build] Ensure version is set before channel setup
parent
85580200
No related branches found
No related tags found
No related merge requests found
Pipeline
#26040
canceled
6 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/build.py
+23
-22
23 additions, 22 deletions
bob/devtools/build.py
with
23 additions
and
22 deletions
bob/devtools/build.py
+
23
−
22
View file @
3e8fa043
...
@@ -278,6 +278,29 @@ if __name__ == '__main__':
...
@@ -278,6 +278,29 @@ if __name__ == '__main__':
bootstrap
.
set_environment
(
'
LC_ALL
'
,
os
.
environ
[
'
LANG
'
],
os
.
environ
,
bootstrap
.
set_environment
(
'
LC_ALL
'
,
os
.
environ
[
'
LANG
'
],
os
.
environ
,
verbose
=
True
)
verbose
=
True
)
# get information about the version of the package being built
version
=
open
(
"
version.txt
"
).
read
().
rstrip
()
os
.
environ
[
'
BOB_PACKAGE_VERSION
'
]
=
version
logger
.
info
(
'
os.environ[
"
%s
"
] = %s
'
,
'
BOB_PACKAGE_VERSION
'
,
version
)
# if we're building a stable release, ensure a tag is set
parsed_version
=
distutils
.
version
.
LooseVersion
(
version
).
version
is_prerelease
=
any
([
isinstance
(
k
,
str
)
for
k
in
parsed_version
])
if
is_prerelease
:
if
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
not
None
:
raise
EnvironmentError
(
'"
version.txt
"
indicates version is a
'
\
'
pre-release (v%s) - but os.environ[
"
CI_COMMIT_TAG
"
]=
"
%s
"
,
'
\
'
which indicates this is a **stable** build.
'
\
'
Have you created the tag using ``bdt release``?
'
,
version
,
os
.
environ
[
'
CI_COMMIT_TAG
'
])
else
:
#it is a stable build
if
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
None
:
raise
EnvironmentError
(
'"
version.txt
"
indicates version is a
'
\
'
stable build (v%s) - but there is no os.environ[
"
CI_COMMIT_TAG
"
]
'
\
'
variable defined, which indicates this is **not**
'
\
'
a tagged build. Use ``bdt release`` to create stable releases
'
,
version
)
# create the build configuration
# create the build configuration
conda_build_config
=
os
.
path
.
join
(
mydir
,
'
data
'
,
'
conda_build_config.yaml
'
)
conda_build_config
=
os
.
path
.
join
(
mydir
,
'
data
'
,
'
conda_build_config.yaml
'
)
recipe_append
=
os
.
path
.
join
(
mydir
,
'
data
'
,
'
recipe_append.yaml
'
)
recipe_append
=
os
.
path
.
join
(
mydir
,
'
data
'
,
'
recipe_append.yaml
'
)
...
@@ -300,28 +323,6 @@ if __name__ == '__main__':
...
@@ -300,28 +323,6 @@ if __name__ == '__main__':
conda_config
=
make_conda_config
(
conda_build_config
,
pyver
,
recipe_append
,
conda_config
=
make_conda_config
(
conda_build_config
,
pyver
,
recipe_append
,
condarc_options
)
condarc_options
)
version
=
open
(
"
version.txt
"
).
read
().
rstrip
()
os
.
environ
[
'
BOB_PACKAGE_VERSION
'
]
=
version
logger
.
info
(
'
os.environ[
"
%s
"
] = %s
'
,
'
BOB_PACKAGE_VERSION
'
,
version
)
# if we're build a stable release, ensure a tag is set
parsed_version
=
distutils
.
version
.
LooseVersion
(
version
).
version
is_prerelease
=
any
([
isinstance
(
k
,
str
)
for
k
in
parsed_version
])
if
is_prerelease
:
if
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
not
None
:
raise
EnvironmentError
(
'"
version.txt
"
indicates version is a
'
\
'
pre-release (v%s) - but os.environ[
"
CI_COMMIT_TAG
"
]=
"
%s
"
,
'
\
'
which indicates this is a **stable** build.
'
\
'
Have you created the tag using ``bdt release``?
'
,
version
,
os
.
environ
[
'
CI_COMMIT_TAG
'
])
else
:
#it is a stable build
if
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
None
:
raise
EnvironmentError
(
'"
version.txt
"
indicates version is a
'
\
'
stable build (v%s) - but there is no os.environ[
"
CI_COMMIT_TAG
"
]
'
\
'
variable defined, which indicates this is **not**
'
\
'
a tagged build. Use ``bdt release`` to create stable releases
'
,
version
)
# retrieve the current build number for this build
# retrieve the current build number for this build
build_number
,
_
=
next_build_number
(
channels
[
0
],
name
,
version
,
pyver
)
build_number
,
_
=
next_build_number
(
channels
[
0
],
name
,
version
,
pyver
)
bootstrap
.
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
),
bootstrap
.
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment