Skip to content

Commit

Permalink
Merge pull request #14 from cncf-infra/add-repo-cloning
Browse files Browse the repository at this point in the history
Add repo cloning
  • Loading branch information
BobyMCbobs authored Dec 15, 2022
2 parents 2fdb483 + 3da7be1 commit db167f5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
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

0 comments on commit db167f5

Please sign in to comment.