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
1d6c5199
Commit
1d6c5199
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[deploy] Avoid stable/master doc deployment from non-master via flag
parent
9d545f8a
No related branches found
No related tags found
1 merge request
!51
Avoid stable/master doc deployment from non-master via flag
Pipeline
#29518
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/deploy.py
+10
-4
10 additions, 4 deletions
bob/devtools/deploy.py
bob/devtools/scripts/ci.py
+16
-3
16 additions, 3 deletions
bob/devtools/scripts/ci.py
with
26 additions
and
7 deletions
bob/devtools/deploy.py
+
10
−
4
View file @
1d6c5199
...
...
@@ -78,8 +78,8 @@ def deploy_conda_package(package, arch, stable, public, username, password,
davclient
.
upload
(
local_path
=
package
,
remote_path
=
remote_path
)
def
deploy_documentation
(
path
,
package
,
stable
,
public
,
branch
,
tag
,
username
,
password
,
dry_run
):
def
deploy_documentation
(
path
,
package
,
stable
,
latest
,
public
,
branch
,
tag
,
username
,
password
,
dry_run
):
'''
Deploys sphinx documentation to the appropriate webdav locations
Args:
...
...
@@ -88,6 +88,11 @@ def deploy_documentation(path, package, stable, public, branch, tag, username,
package (str): Full name (with namespace) of the package being treated
stable (bool): Indicates if the documentation corresponds to the latest
stable build
latest (bool): Indicates if the documentation being deployed correspond to
the latest stable for the package or not. In case the documentation
comes from a patch release which is not on the master branch, please set
this flag to ``False``, which will make us avoid deployment of the
documentation to ``master`` and ``stable`` sub-directories.
public (bool): Indicates if the documentation is supposed to be distributed
publicly or privatly (within Idiap network)
branch (str): The name of the branch for the current build
...
...
@@ -120,10 +125,11 @@ def deploy_documentation(path, package, stable, public, branch, tag, username,
# "stable" subdir as well
deploy_docs_to
=
set
([
branch
])
if
stable
:
deploy_docs_to
.
add
(
'
master
'
)
if
tag
is
not
None
:
deploy_docs_to
.
add
(
tag
)
deploy_docs_to
.
add
(
'
stable
'
)
if
latest
:
deploy_docs_to
.
add
(
'
master
'
)
deploy_docs_to
.
add
(
'
stable
'
)
# creates package directory, and then uploads directory there
for
k
in
deploy_docs_to
:
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/ci.py
+
16
−
3
View file @
1d6c5199
...
...
@@ -86,14 +86,27 @@ Examples:
$ bdt ci deploy -vv
2. Deploys stable release from non-master branch (e.g. you
'
re releasing a patch release for an older version of a package):
$ bdt ci deploy -vv --no-latest
'''
)
@click.option
(
'
-n
'
,
'
--latest/--no-latest
'
,
default
=
True
,
help
=
'
If set (the default), for stable builds, deploy documentation
'
\
'
to both
"
stable
"
and
"
master
"
branches, besides
"
<branch>
"
and
'
\
'"
<tag>
"
- otherwise, only deploys documentation to
"
<branch>
"
'
\
'
and
"
<tag>
"
. This option is useful if you are publishing
'
\
'
corrections of a release from a stable branch which is **NOT**
'
\
'
the master branch, so you would not like to overwrite
'
\
'
documentation deployments for
"
stable
"
and
"
master
"'
)
@click.option
(
'
-d
'
,
'
--dry-run/--no-dry-run
'
,
default
=
False
,
help
=
'
Only goes through the actions, but does not execute them
'
\
'
(combine with the verbosity flags - e.g. ``-vvv``) to enable
'
\
'
printing to help you understand what will be done
'
)
@verbosity_option
()
@bdt.raise_on_error
def
deploy
(
dry_run
):
def
deploy
(
latest
,
dry_run
):
"""
Deploys build artifacts (conda packages and sphinx documentation)
Deployment happens at the
"
right
"
locations - conda packages which do not
...
...
@@ -129,8 +142,8 @@ def deploy(dry_run):
overwrite
=
False
,
dry_run
=
dry_run
)
local_docs
=
os
.
path
.
join
(
os
.
environ
[
'
CI_PROJECT_DIR
'
],
'
sphinx
'
)
deploy_documentation
(
local_docs
,
package
,
stable
=
stable
,
public
=
public
,
branch
=
os
.
environ
[
'
CI_COMMIT_REF_NAME
'
],
deploy_documentation
(
local_docs
,
package
,
stable
=
stable
,
latest
=
latest
,
public
=
public
,
branch
=
os
.
environ
[
'
CI_COMMIT_REF_NAME
'
],
tag
=
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
),
username
=
os
.
environ
[
'
DOCUSER
'
],
password
=
os
.
environ
[
'
DOCPASS
'
],
dry_run
=
dry_run
)
...
...
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