Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repo cloning #14

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions kubevirt-talos/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,24 @@ resource "coder_agent" "main" {
fi
echo 'export PATH="$PATH:$HOME/bin"' >> $HOME/.bashrc
mkdir -p bin
curl -o bin/kubectl -L https://dl.k8s.io/v1.25.2/bin/linux/amd64/kubectl
chmod +x bin/*

(
cd
for repo in $INIT_DEFAULT_REPOS; do (git-clone-structured "https://github.com/$repo" || true); done
) | tee repo-clone.log &

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &
EOT
}

variable "repos" {
type = string
description = "GitHub repos to clone; i.e: kubernetes/kubernetes, cncf/k8s-conformance"
default = "kubernetes/kubernetes"
}

# code-server
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
Expand Down Expand Up @@ -571,6 +580,7 @@ resource "kubernetes_manifest" "configmap_capi_init" {
coder_command = jsonencode(["sh", "-c", coder_agent.main.init_script]),
coder_token = coder_agent.main.token
instance_name = data.coder_workspace.me.name
repos = var.repos
})
}
}
Expand Down
6 changes: 6 additions & 0 deletions kubevirt-talos/cool.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ spec:
value: "true"
- name: REINIT_HOME_FOLDER
value: "true"
- name: INIT_DEFAULT_REPOS_FOLDER
value: /home/ii
- name: INIT_DEFAULT_DIR
value: /home/ii
- name: INIT_DEFAULT_REPOS
value: ${repos}
volumeMounts:
- mountPath: /run/containerd/containerd.sock
name: run-containerd-containerd-sock
Expand Down