Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 7325a304 authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

Merge branch '6-register-runner' into 'master'

Resolve "Register runner"

Closes #6

See merge request froggit/mygr!6
parents bf7ce92f ff8bde70
No related branches found
No related tags found
1 merge request!6Resolve "Register runner"
Pipeline #83 failed
......@@ -14,15 +14,40 @@ load_config() {
create_config(){
echo "There is no file!"
touch ${CONFIG_FILE}
echo "The file ${CONFIG_FILE} was created."
echo "What is the GitLab URL :"
read -r gitlab_url
echo "What is the GitLab registration token :"
read -rs gitlab_registration_token
echo "gitlab_url=\"${gitlab_url}\"" > ${CONFIG_FILE}
echo "gitlab_registration_token=\"${gitlab_registration_token}\"" >> ${CONFIG_FILE}
echo "The file ${CONFIG_FILE} was created with this content."
echo "Please add the line below on your .gitignore"
echo "${CONFIG_FILE}"
}
runner_register() {
docker run --rm -v gitlab-runner-config:/etc/gitlab-runner \
gitlab/gitlab-runner register \
--non-interactive \
--url "${gitlab_url}" \
--registration-token "${gitlab_registration_token}" \
--executor "docker" \
--docker-image alpine:latest \
--description "My GitLab Runner docker" \
--tag-list "docker" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected"
}
main() {
echo "My GitLab Runner"
load_config
runner_register
}
main "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment