►
From YouTube: How to automate creating GitLab Runners
Description
In this video, we demo how to use the create a CI Runner API to automatically create and register a GitLab Runner to an instance, group, or project.
https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner
A
Hi
this
in
this
video
I'm
going
to
show
you
the
changes
that
are
coming
in
terms
of
registering
Runners,
namely
in
the
rest,
API,
slash
runners.
This
API
is
going
to
stop
working
in
16.6
through
a
feature
flag
and
it's
going
to
be
disabled
completely
in
17-0.
A
A
The
arguments
is,
are
more
or
less
the
same,
but
you're
able
to
pass
a
runner
type,
and
you
know
group
project
ID,
depending
if
you're,
creating
under
those
scopes,
but
you're
still
able
to
pass
the
tag
list,
whether
it's
locked
posts
Etc
so
yeah.
We
can
go
into
a
small
demo
here.
I
have
this
project,
which
has
the
id23
I?
Think
it's
not
completely
loaded.
A
Okay,
there
we
go
so
let's
go
into
the
access
tokens
page
to
create
a
bot
project
token,
and
we
have
to
set
a
owner
role
or
it
could
be
for
projects
you
you're
able
to
do
that
with
the
maintainer
role
and
API
scope.
This
is
something
that
will
we
plan
to
improve
in
the
future
to
create
a
new
scope
solely
for
creating
Runners,
but
for
now
we
have
to
use
the
API
scope.
So
let's
go
ahead,
create
this
okay,
we
can
see
the
scope.
A
The
token
was
created
here
and
we
can
go
into
the
command
line.
Let's
copy.
This
commands
that
I
have
prepared
here
where
we're
hitting
this
new
API
with
the
Json
type
we're
requesting
a
project
Runner
under
the
project.
Id
is
23,
we're
passing
a
description
and
a
tag
list.
A
Okay
and
we're
passing
to
JQ
just
to
get
some
nicely
colored
outputs,
okay,
so
it's
created
the
runner
and
returns
an
authentication
token
for
that
Runner.
We
can
now
see
the
the
runner
in
the
cicd
page.
A
There
we
go
so
automatically
registered,
it's
verified
that
the
token
is
valid,
and
if
we
go
here
and
refresh
the
page,
we
can
see
that
the
runner
is
online
okay.
So
this
takes
care
of
registering
project
Runners
for
group
Runners.
If
we
go
to
the
gitlab
group,
the
process
would
be
exactly
the
same.
You
would
go
to
access
tokens,
select
owner
role
and
API
scope
and
create
that
so
pretty
much
the
same,
you
would
just
need
to
change
the
runner
type
to
be
group
type
and
pass
group
ID,
that's
pretty
much
it
now.
A
We
can
look
into
creating
an
instance
Runner,
and
for
that
you
would
go
to
the
profile,
go
into
access
tokens
and,
let's
say
I
bought
with
API
scope,
create
that
personal
access,
token.
Okay.
We
have
it
here.
So
let's
run
that
command
here
and
use
that
token.
A
And
just
to
make
it
a
bit
more
realistic,
let's
ask
for
raw
output
and
go
directly
into
the
token
so
yeah
there.
We
have
our
token
and
let's
stretch
to
that
oops.