Check string quoting in libvert.md
As part of technical-writing#339 (closed) to test curl
strings in code examples, the Technical Writing team needs some assistance. On line 37 and 38 of https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/executors/custom_examples/libvirt.md#L37 the info for --run-command
is wrapped in double quotes, and the URL itself is unquoted:
virt-builder debian-9 \
--size 8G \
--output /var/lib/libvirt/images/gitlab-runner-base.qcow2 \
--format qcow2 \
--hostname gitlab-runner-stretch \
--network \
--install curl \
--run-command "curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | bash" \
--run-command "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" \
--run-command 'useradd -m -p "" gitlab-runner -s /bin/bash' \
--install gitlab-runner,git,git-lfs,openssh-server \
--run-command "git lfs install --skip-repo" \
--ssh-inject gitlab-runner:file:/root/.ssh/id_rsa.pub \
--run-command "echo 'gitlab-runner ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" \
--run-command "sed -E 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/' -i /etc/default/grub" \
--run-command "grub-mkconfig -o /boot/grub/grub.cfg" \
--run-command "echo 'auto eth0' >> /etc/network/interfaces" \
--run-command "echo 'allow-hotplug eth0' >> /etc/network/interfaces" \
--run-command "echo 'iface eth0 inet dhcp' >> /etc/network/interfaces"
Is it possible to change these two lines
--run-command "curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | bash" \
--run-command "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash" \
to use single quotes around the outside of the string, and double quotes around the URL itself, like this?
--run-command 'curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | bash' \
--run-command 'curl -s "https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh" | bash \
@steveazz suggested in #s_verify
chat that the second line might be problematic, but I have no way of testing this out for myself.
Potential outcomes
- Fix the strings in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/executors/custom_examples/libvirt.md to be compliant with the regex in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/.vale/gitlab/CurlStringsQuoted.yml. Then remove the
vale off
andvale on
tags I'm about to add to the page, to disable testing on this code example. MR link TBD. - Determine the code in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/executors/custom_examples/libvirt.md can't be compliant with the regex in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/.vale/gitlab/CurlStringsQuoted.yml. Add a HTML comment to https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/docs/executors/custom_examples/libvirt.md pointing to this issue so future technical writers won't have to blindly guess why Vale's linting was turned off on this section of the page. (We try to avoid turning off linting, obviously.)
Related issues
Related to technical-writing#339 (closed) where we're working toward enabling this rule across the gitlab
, charts
, gitlab-runner
, and omnibus-gitlab
repositories.