Skip to content

Draft: Add write-file subcommand to helper binary

Arran Walker requested to merge ajwalker/add-write-file-subcommand into main

What does this MR do?

Adds a write-file subcommand to the helper binary.

Why was this MR needed?

This introduces a mechanism for us to write files to the job's environment without relying on shell script.

Maintaining different shell scripts is difficult and error prone.

What's the best way to test this MR?

Manual test sub-command

# create file
echo "hi" | ./gitlab-runner write-file -mode 777 my-file

# check contents
cat my-file

# check mode
stat my-file

Kubernetes

This sub-command is used by Kubernetes:

Follow the same steps of "how to test this MR" from !3900 (merged).

What are the relevant issue numbers?

Merge request reports