Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
1007a84d
Commit
1007a84d
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Add deploy to PyPI step
parent
510dbda3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ci/pypi.sh
+71
-0
71 additions, 0 deletions
ci/pypi.sh
templates/ci-for-cxx-extensions.yml
+35
-2
35 additions, 2 deletions
templates/ci-for-cxx-extensions.yml
templates/ci-for-python-only.yml
+43
-5
43 additions, 5 deletions
templates/ci-for-python-only.yml
with
149 additions
and
7 deletions
ci/pypi.sh
0 → 100755
+
71
−
0
View file @
1007a84d
#!/usr/bin/env bash
# Wed 21 Sep 2016 13:08:05 CEST
# Functions for coloring echo commands
red_echo
()
{
echo
-e
"
\0
33[1;31m
${
@
}
\0
33[0m"
}
green_echo
()
{
echo
-e
"
\0
33[1;32m
${
@
}
\0
33[0m"
}
if
[
-z
"
${
PYPIUSER
}
"
]
||
[
-z
"
${
PYPIPASS
}
"
]
;
then
red_echo
"PYPIUSER and/or PYPIPASS undefined - aborting..."
;
exit
1
fi
if
[
-z
"
${
CI_BUILD_TAG
}
"
]
;
then
red_echo
"CI_BUILD_TAG undefined - can only work with tags, aborting..."
;
exit
1
fi
PYPISERVER
=
`
[
-z
"
${
PYPISERVER
}
"
]
||
https://pypi.python.org
`
TESTSERVER
=
https://testpypi.python.org
cat
<<
EOT
>> ~/.pypirc
[distutils]
index-servers =
production
staging
[production]
repository:
${
PYPISERVER
}
username:
${
PYPIUSER
}
password:
${
PYPIPASS
}
[staging]
repository: https://testpypi.python.org/
username:
${
PYPIUSER
}
password:
${
PYPIPASS
}
EOT
chmod
600 ~/.pypirc
setup
()
{
local
cmd
=
python setup.py
"
${
@
}
"
green_echo
"[>>] Running
${
cmd
}
..."
local
status
=
$?
if
[
${
status
}
!=
0
]
;
then
red_echo
"Command
\"
${
cmd
}
\"
failed - aborting..."
rm
-f
~/.pypirc
exit
${
status
}
fi
}
green_echo
"[>>] Uploading first to
${
TESTSERVER
}
on behalf of
${
PYPIUSER
}
..."
setup check sdist
--formats
zip upload
--repository
staging
green_echo
"[<<] Test finished, proceeding..."
# if that worked, uploads documentation to pythonhosted
green_echo
"[>>] Uploading documentation on behalf of
${
PYPIUSER
}
..."
setup upload_docs
--upload-dir
sphinx
green_echo
"[<<] Documentation uploaded, proceeding..."
# if that worked, uploads source package to the production index
green_echo
"[>>] Uploading package to
${
PYPISERVER
}
on behalf of
${
PYPIUSER
}
..."
setup check sdist
--formats
zip upload
--repository
production
green_echo
"[<<] Package deployed, goodbye."
# cleanup
rm
-f
~/.pypirc
exit
0
This diff is collapsed.
Click to expand it.
templates/ci-for-cxx-extensions.yml
+
35
−
2
View file @
1007a84d
...
...
@@ -14,6 +14,7 @@ stages:
-
test
-
docs
-
wheels
-
deploy
# Global variables
...
...
@@ -88,9 +89,10 @@ variables:
# architectures (Linux and Mac OSX 64-bit)
.wheels_template
:
&wheels_job
stage
:
wheels
environment
:
intranet
only
:
-
master
-
tags
-
/^v\d+\.\d+\.\d+([abc]\d*)?$/
# PEP-440 compliant version (
tags
)
before_script
:
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/wheels.sh > wheels.sh
-
chmod 755 wheels.sh
...
...
@@ -102,6 +104,7 @@ variables:
# Only one real job needs to do this
.docs_template
:
&docs_job
stage
:
docs
environment
:
intranet
only
:
-
master
before_script
:
...
...
@@ -111,6 +114,29 @@ variables:
-
./docs.sh
# Template for the pypi stage - re-install from uploaded wheels
# Needs to run on a single architecture
.deploy_template
:
&deploy_job
stage
:
deploy
environment
:
pypi
only
:
-
/^v\d+\.\d+\.\d+([abc]\d*)?$/
# PEP-440 compliant version (tags)
except
:
-
branches
before_script
:
-
./bootstrap.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX}
-
source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX}
-
pip install --use-wheel --no-index --pre dist/*.whl
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/pypi.sh > pypi.sh
-
chmod 755 pypi.sh
script
:
-
source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX}
-
./pypi.sh
after_script
:
-
rm -rf ~/.pypirc
-
rm -rf ${CONDA_PREFIX}
# 2) Package specific instructions (you may tune this if needed)
# --------------------------------------------------------------
...
...
@@ -164,7 +190,7 @@ wheels_linux_34:
-
conda-linux
# Linux + Python 3.5: Builds
and test
s
# Linux + Python 3.5: Builds
, tests and deploy
s
build_linux_35
:
<<
:
*linux_build_job
variables
:
&linux_35_build_variables
...
...
@@ -195,6 +221,13 @@ docs_linux_35:
tags
:
-
conda-linux
deploy_linux_35
:
<<
:
*deploy_job
dependencies
:
-
build_linux_35
tags
:
-
conda-linux
# Mac OSX + Python 2.7: Builds, tests and uploads the wheel
build_macosx_27
:
...
...
This diff is collapsed.
Click to expand it.
templates/ci-for-python-only.yml
+
43
−
5
View file @
1007a84d
...
...
@@ -14,6 +14,7 @@ stages:
-
test
-
docs
-
wheels
-
deploy
# Global variables
...
...
@@ -89,22 +90,52 @@ variables:
# architectures (Linux and Mac OSX 64-bit)
.wheels_template
:
&wheels_job
stage
:
wheels
environment
:
intranet
only
:
-
master
-
tags
-
/^v\d+\.\d+\.\d+([abc]\d*)?$/
# PEP-440 compliant version (
tags
)
before_script
:
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/
doc
s.sh >
doc
s.sh
-
chmod 755
doc
s.sh
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/
wheel
s.sh >
wheel
s.sh
-
chmod 755
wheel
s.sh
script
:
-
./
doc
s.sh
-
./
wheel
s.sh
# Template for (latest) documentation upload stage
# Only one real job needs to do this
.docs_template
:
&docs_job
stage
:
docs
environment
:
intranet
only
:
-
master
before_script
:
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/docs.sh > docs.sh
-
chmod 755 docs.sh
script
:
-
./docs.sh
# Template for the pypi stage - re-install from uploaded wheels
# Needs to run on a single architecture
.deploy_template
:
&deploy_job
stage
:
deploy
environment
:
pypi
only
:
-
/^v\d+\.\d+\.\d+([abc]\d*)?$/
# PEP-440 compliant version (tags)
except
:
-
branches
before_script
:
-
./bootstrap.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX}
-
source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX}
-
pip install --use-wheel --no-index --pre dist/*.whl
-
curl --silent https://gitlab.idiap.ch/bob/bob.admin/raw/master/ci/pypi.sh > pypi.sh
-
chmod 755 pypi.sh
script
:
-
source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX}
-
./pypi.sh
after_script
:
-
rm -rf ~/.pypirc
-
rm -rf ${CONDA_PREFIX}
# 2) Package specific instructions (you may tune this if needed)
...
...
@@ -155,7 +186,7 @@ test_linux_34:
-
conda-linux
# Linux + Python 3.5: Builds, tests, uploads wheel
# Linux + Python 3.5: Builds, tests, uploads wheel
and deploys
build_linux_35
:
<<
:
*linux_build_job
variables
:
&linux_35_build_variables
...
...
@@ -187,6 +218,13 @@ docs_linux_35:
tags
:
-
conda-linux
deploy_linux_35
:
<<
:
*deploy_job
dependencies
:
-
build_linux_35
tags
:
-
conda-linux
# Mac OSX + Python 2.7: Builds and tests
build_macosx_27
:
...
...
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