Copy homebrew from homebrew image if not already installed
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
06ffee9120
commit
32d5376e18
29
base.tf.j2
29
base.tf.j2
@ -231,16 +231,6 @@ resource "coder_agent" "main" {
|
||||
|
||||
git config --global user.name "${data.coder_parameter.git_user_name.value == "" ? data.coder_workspace.me.owner : data.coder_parameter.git_user_name.value}"
|
||||
git config --global user.email "${data.coder_parameter.git_email.value == "" ? data.coder_workspace.me.owner_email : data.coder_parameter.git_email.value}"
|
||||
|
||||
if [ -d "/home/linuxbrew/.linuxbrew" ]; then
|
||||
if [ -d "$HOME/.linuxbrew" ]; then
|
||||
sudo rm -rf /home/linuxbrew/.linuxbrew
|
||||
else
|
||||
sudo mv /home/linuxbrew/.linuxbrew $HOME/.linuxbrew
|
||||
fi
|
||||
|
||||
sudo ln -s $HOME/.linuxbrew /home/linuxbrew/.linuxbrew
|
||||
fi
|
||||
{% endblock %}
|
||||
|
||||
{% block post_startup_script_setup_home %}
|
||||
@ -591,6 +581,25 @@ resource "kubernetes_deployment" "main" {
|
||||
{% block additional_containers %}
|
||||
{% endblock %}
|
||||
|
||||
{% block homebrew_init_container %}
|
||||
init_container "homebrew_init_container" {
|
||||
content {
|
||||
name = "homebrew-init"
|
||||
image = "homebrew/brew:latest"
|
||||
# /bin/sh -c ''
|
||||
command = ["sh", "-c", "test -d /mnt/linuxbrew/.linuxbrew/bin || rsync -av /home/linuxbrew/ /mnt/linuxbrew/"]
|
||||
image_pull_policy = "{{ image_pull_policy }}"
|
||||
|
||||
volume_mount {
|
||||
mount_path = "/mnt/linuxbrew"
|
||||
name = "home"
|
||||
sub_path = ".linuxbrew"
|
||||
read_only = false
|
||||
}
|
||||
}
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block kubernetes_pod_nvidia_sidecar %}
|
||||
dynamic "container" {
|
||||
for_each = data.coder_parameter.gpu.value == "0" ? [] : [1]
|
||||
|
||||
Reference in New Issue
Block a user