Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
mantidproject
mantid
Commits
98a5cb7a
Commit
98a5cb7a
authored
8 years ago
by
Martyn Gigg
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #17847 from mantidproject/17842-conda-jenkins
Improve Conda-recipe-update script to be reused in Jenkins build
parents
1bdb5ccb
cf55747e
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
buildconfig/CMake/conda.cmake
+2
-2
2 additions, 2 deletions
buildconfig/CMake/conda.cmake
buildconfig/CMake/conda_update_recipe.py.in
+30
-7
30 additions, 7 deletions
buildconfig/CMake/conda_update_recipe.py.in
with
32 additions
and
9 deletions
buildconfig/CMake/conda.cmake
+
2
−
2
View file @
98a5cb7a
set
(
CONDA_WORKDIR
"conda-packaging"
)
configure_file
(
buildconfig/CMake/conda
-
update
-
recipe.py.in
${
CONDA_WORKDIR
}
/conda
-
update
-
recipe.py
)
configure_file
(
buildconfig/CMake/conda
_
update
_
recipe.py.in
${
CONDA_WORKDIR
}
/conda
_
update
_
recipe.py
)
add_custom_target
(
conda-update-recipe
COMMAND python conda
-
update
-
recipe.py
COMMAND python conda
_
update
_
recipe.py
WORKING_DIRECTORY
${
CONDA_WORKDIR
}
)
This diff is collapsed.
Click to expand it.
buildconfig/CMake/conda
-
update
-
recipe.py.in
→
buildconfig/CMake/conda
_
update
_
recipe.py.in
+
30
−
7
View file @
98a5cb7a
...
...
@@ -5,17 +5,24 @@ git_rev = "@MtdVersion_WC_LAST_CHANGED_SHA_LONG@"
import subprocess as sp, shlex, os
def
main(
):
def
checkout(repo_path
):
# checkout recipe
if not os.path.exists(
'conda-recipes'
):
if not os.path.exists(
repo_path
):
cmd = 'git clone git@github.com:mantidproject/conda-recipes'
sp.check_call(cmd.split())
else:
cmd = 'git pull'
sp.check_call(cmd.split(), cwd='conda-recipes')
sp.check_call(cmd.split(), cwd=repo_path)
return
def update_meta_yaml(repo_path, recipe_path=None):
"return: True if updated"
recipe_path = recipe_path or 'framework'
if not os.path.isabs(recipe_path):
recipe_path = os.path.join(repo_path, recipe_path)
# change framework meta.yaml
path =
'conda-recipes/framework/
meta.yaml'
path =
os.path.join(recipe_path, '
meta.yaml'
)
header = []
header.append('{% set version = "' + '%s' % version + '" %}')
header.append('{% set git_rev = "' + '%s' % git_rev + '" %}')
...
...
@@ -25,16 +32,32 @@ def main():
# if nothing changed just exit
if header == old_header:
print "Nothing changed. Skipping."
return
return
False
open(path, 'wt').write('\n'.join(header+body))
return True
def commit(repo_path):
# commit
cmd = 'git commit -m "update version and git_rev" framework/meta.yaml'
sp.check_call(shlex.split(cmd), cwd="conda-recipes")
sp.check_call(shlex.split(cmd), cwd=repo_path)
return
def push(repo_path):
# push
cmd = 'git push'
sp.check_call(cmd.split(), cwd=
"conda-recipes"
)
sp.check_call(cmd.split(), cwd=
repo_path
)
return
def main():
repo_path = 'conda-recipes'
checkout(repo_path)
if update_meta_yaml(repo_path):
commit(repo_path)
push(repo_path)
return
if __name__ == '__main__': main()
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