Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-18 18:09:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-18 18:09:04 +0300
commitdfda8b7e77835fc54d469eda336b13b415365703 (patch)
treeb94d991d464dc1e98f0f365e1e15e94c3ee8c9ca /doc/development/agent
parent19d46f60a3699232458357111365e63a8c71f20d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/agent')
-rw-r--r--doc/development/agent/identity.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/development/agent/identity.md b/doc/development/agent/identity.md
index 49d20d2fd87..83af4318de9 100644
--- a/doc/development/agent/identity.md
+++ b/doc/development/agent/identity.md
@@ -92,3 +92,15 @@ GitLab provides the following information in its response for a given Agent acce
- Agent configuration Git repository. (The agent doesn't support per-folder authorization.)
- Agent name.
+
+## Create an agent
+
+You can create an agent by following the [user documentation](../../user/clusters/agent/index.md#create-an-agent-record-in-gitlab), or via Rails console:
+
+```ruby
+project = ::Project.find_by_full_path("path-to/your-configuration-project")
+# agent-name should be the same as specified above in the config.yaml
+agent = ::Clusters::Agent.create(name: "<agent-name>", project: project)
+token = ::Clusters::AgentToken.create(agent: agent)
+token.token # this will print out the token you need to use on the next step
+```