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
Merge requests
!190
Add an alternative command to nightlies
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add an alternative command to nightlies
alt-nightlies
into
master
Overview
0
Commits
2
Pipelines
4
Changes
4
Merged
Amir MOHAMMADI
requested to merge
alt-nightlies
into
master
4 years ago
Overview
0
Commits
2
Pipelines
4
Changes
4
Expand
This is like nightlies with resume. You can avoid rebuilding all packages.
Edited
4 years ago
by
Amir MOHAMMADI
0
0
Merge request reports
Compare
master
version 3
59863df4
4 years ago
version 2
2b8b1e1b
4 years ago
version 1
817fcb8e
4 years ago
master (base)
and
latest version
latest version
c16097d8
2 commits,
4 years ago
version 3
59863df4
2 commits,
4 years ago
version 2
2b8b1e1b
2 commits,
4 years ago
version 1
817fcb8e
2 commits,
4 years ago
4 files
+
80
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
bob/devtools/scripts/alternative_nightlies.py
0 → 100644
+
75
−
0
Options
import
click
from
..log
import
verbosity_option
from
.
import
bdt
@click.command
(
epilog
=
"""
Examples:
1. Runs an alternate to nightly builds following a list of packages in a file:
$ bdt gitlab alt-nightlies -vv order.txt
2. Provide a list of key value pairs of arguments to be used as variables in the CI
$ bdt gitlab alt-nightlies -vv order.txt NOSE_EVAL_ATTR
"
not slow
"
"""
)
@click.argument
(
"
order
"
,
required
=
True
,
type
=
click
.
Path
(
file_okay
=
True
,
dir_okay
=
False
,
exists
=
True
),
nargs
=
1
,
)
@click.argument
(
"
variables
"
,
nargs
=-
1
,
)
@verbosity_option
()
@bdt.raise_on_error
def
alt_nightlies
(
order
,
variables
):
"""
Alternative nightlies.
This command should be run locally and not in Gitlab CI.
It will trigger a pipeline for each package in the order file
"""
if
not
variables
:
variables
=
[]
final_variables
=
[]
for
i
,
v
in
enumerate
(
variables
):
if
i
%
2
==
1
:
continue
final_variables
.
append
({
"
key
"
:
v
,
"
value
"
:
variables
[
i
+
1
]})
import
time
from
..ci
import
read_packages
from
..log
import
get_logger
from
..release
import
get_gitlab_instance
logger
=
get_logger
(
__name__
)
gl
=
get_gitlab_instance
()
packages
=
read_packages
(
order
)
for
n
,
(
package
,
branch
)
in
enumerate
(
packages
):
# trigger a pipeline for package and branch
project
=
gl
.
projects
.
get
(
package
)
logger
.
info
(
f
"
Creating a pipeline for
{
package
}
branch
{
branch
}
with variables
{
final_variables
}
"
)
pipeline
=
project
.
pipelines
.
create
(
{
"
ref
"
:
branch
,
"
variables
"
:
final_variables
}
)
# wait for it to finish
while
pipeline
.
status
in
(
"
pending
"
,
"
running
"
):
time
.
sleep
(
3
)
pipeline
.
refresh
()
continue
if
pipeline
.
status
==
"
success
"
:
continue
raise
RuntimeError
(
f
"
Pipeline
{
pipeline
.
web_url
}
{
pipeline
.
status
}
"
)
Loading