11# cloud-config
22runcmd :
3- - apt update && apt install -y jq zip unzip curl wget git docker.io docker-compose-v2
3+ - apt update && apt install -y jq zip unzip curl wget git devscripts docker.io docker-compose-v2 docker-buildx
44 # install github cli
55 - mkdir -p -m 755 /etc/apt/keyrings
66 - wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
@@ -12,40 +12,53 @@ runcmd:
1212 - apt install -y nodejs python3 python-is-python3 g++ make
1313 # install task cli
1414 - su - root -c "curl -o ./task-install.sh -L https://taskfile.dev/install.sh"
15- - su - root -c "chmod +x ./task-install.sh && ./task-install.sh -d - b /usr/local/bin"
15+ - su - root -c "chmod +x ./task-install.sh && ./task-install.sh -b /usr/local/bin -d 'v${TASK_VERSION}' "
1616 # install aws cli
17- - su - root -c "curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscli.zip"
17+ - su - root -c "curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWSCLI_VERSION} .zip -o awscli.zip"
1818 - su - root -c "unzip awscli.zip && ./aws/install --update && rm -rf awscli.zip && rm -rf ./aws"
1919 # install yc cli
2020 - su - root -c "curl -o ./yc-install.sh -L https://storage.yandexcloud.net/yandexcloud-yc/install.sh"
21- - su - root -c "chmod +x ./yc-install.sh && ./yc-install.sh -i /tmp/yc -n && rm -rf ./yc-install.sh && mv /tmp/yc/bin/yc /usr/bin/yc"
21+ - su - root -c "chmod +x ./yc-install.sh && CLI_VERSION='${YC_VERSION}' ./yc-install.sh -i /tmp/yc -n && rm -rf ./yc-install.sh && mv /tmp/yc/bin/yc /usr/bin/yc"
2222 # install mc cli
2323 - su - root -c "curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o /usr/bin/mc"
2424 - su - root -c "chmod +x /usr/bin/mc"
2525 # install opentofu cli
26- - su - root -c "curl -O -L https://github.com/opentofu/opentofu/releases/download/v1.8.4/tofu_1.8.4_linux_amd64 .zip"
27- - su - root -c "unzip tofu_1.8.4_linux_amd64. zip tofu -d /usr/bin/ && rm -f tofu_1.8.4_linux_amd64 .zip && chmod +x /usr/bin/tofu"
26+ - su - root -c "curl -O -L https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_amd64 .zip"
27+ - su - root -c "unzip tofu_${OPENTOFU_VERSION}_linux_amd64. zip tofu -d /usr/bin/ && rm -f tofu_${OPENTOFU_VERSION}_linux_amd64 .zip && chmod +x /usr/bin/tofu"
2828 # install kubectl cli
29- - su - root -c "curl -L https://dl.k8s.io/release/v1.31.5 /bin/linux/amd64/kubectl -o /usr/bin/kubectl"
29+ - su - root -c "curl -L https://dl.k8s.io/release/v${KUBECTL_VERSION} /bin/linux/amd64/kubectl -o /usr/bin/kubectl"
3030 - su - root -c "chmod +x /usr/bin/kubectl"
3131 # install helm cli
32- - su - root -c "curl -O -L https://get.helm.sh/helm-v3.17.1 -linux-amd64.tar.gz"
33- - su - root -c "tar -xvzf helm-v3.17.1 -linux-amd64.tar.gz && rm -rf helm-v3.17.1 -linux-amd64.tar.gz && mv linux-amd64/helm /usr/bin/helm && rm -rf linux-amd64 && chmod +x /usr/bin/helm"
32+ - su - root -c "curl -O -L https://get.helm.sh/helm-v${HELM_VERSION} -linux-amd64.tar.gz"
33+ - su - root -c "tar -xvzf helm-v${HELM_VERSION} -linux-amd64.tar.gz && rm -rf helm-v${HELM_VERSION} -linux-amd64.tar.gz && mv linux-amd64/helm /usr/bin/helm && rm -rf linux-amd64 && chmod +x /usr/bin/helm"
3434 # install yq cli
35- - su - root -c "curl -O -L https://github.com/mikefarah/yq/releases/download/v4.45.1 /yq_linux_amd64.tar.gz"
35+ - su - root -c "curl -O -L https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION} /yq_linux_amd64.tar.gz"
3636 - su - root -c "tar -xvzf yq_linux_amd64.tar.gz && rm -rf yq_linux_amd64.tar.gz && mv yq_linux_amd64 /usr/bin/yq && chmod +x /usr/bin/yq"
37+ # install trivy cli
38+ - su - root -c "curl -o ./trivy.tar.gz -L https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz"
39+ - su - root -c "tar -xvzf trivy.tar.gz && rm -rf trivy.tar.gz && mv trivy /usr/bin/trivy && chmod +x /usr/bin/trivy"
40+ # install shellformat cli
41+ - su - root -c "curl -L https://github.com/mvdan/sh/releases/download/v${SHFMT_VERSION}/shfmt_v${SHFMT_VERSION}_linux_amd64 -o /usr/bin/shfmt"
42+ - su - root -c "chmod +x /usr/bin/shfmt"
43+ # install shellcheck cli
44+ - su - root -c "curl -O -L https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
45+ - su - root -c "tar -xvf shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz && rm -rf shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz && mv shellcheck-v${SHELLCHECK_VERSION}/shellcheck /usr/bin/shellcheck && chmod +x /usr/bin/shellcheck"
46+ # install yamlfmt cli
47+ - su - root -c "curl -O -L https://github.com/google/yamlfmt/releases/download/v${YAMLFMT_VERSION}/yamlfmt_${YAMLFMT_VERSION}_Linux_x86_64.tar.gz"
48+ - su - root -c "tar -xvf yamlfmt_${YAMLFMT_VERSION}_Linux_x86_64.tar.gz && rm -rf yamlfmt_${YAMLFMT_VERSION}_Linux_x86_64.tar.gz && mv yamlfmt /usr/bin/yamlfmt && chmod +x /usr/bin/yamlfmt"
3749 # add non root user
3850 - useradd -m github --shell /bin/bash && usermod -aG docker github
3951 - su - github -c "mkdir -p /home/github/actions-runner"
4052 # install playwright
4153 - su - root -c "PLAYWRIGHT_BROWSERS_PATH=/home/github/.cache/ms-playwright PLAYWRIGHT_DOWNLOAD_HOST=https://storage.yandexcloud.net/playwright npx -y playwright@${PLAYWRIGHT_VERSION} install --with-deps chromium"
54+ - su - root -c "chown -R github:github /home/github/.cache"
4255 # remove DejaVuSans fonts
4356 - apt purge -y fonts-dejavu-core fonts-dejavu-mono
4457 # install github runner agent
4558 - export RUNNER_ARCH=x64
4659 - export RUNNER_TOKEN=$(yc lockbox payload get --id ${LOCKBOX_ID} --key ${LOCKBOX_KEY})
4760 - su - github -c "cd /home/github/actions-runner && curl -O -L https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-$${RUNNER_ARCH}-${VERSION}.tar.gz"
4861 - su - github -c "cd /home/github/actions-runner && tar xzf ./actions-runner-linux-$${RUNNER_ARCH}-${VERSION}.tar.gz && rm -rf ./actions-runner-linux-$${RUNNER_ARCH}-${VERSION}.tar.gz"
49- - su - github -c "cd /home/github/actions-runner && ./config.sh --unattended --url https://github.com/${OWNER} --token $${RUNNER_TOKEN} --name github-runner-${LABEL}-ind-${IND} --runnergroup default --work _work --labels cloud,${LABEL},${LABEL}-ind-${IND}"
62+ - su - github -c "cd /home/github/actions-runner && ./config.sh --unattended --url https://github.com/${OWNER} --token $${RUNNER_TOKEN} --name github-runner-${LABEL}-ind-${IND} --runnergroup ${RUNNER_GROUP} --replace --work _work --labels cloud,${LABEL},${LABEL}-ind-${IND}"
5063 - su - root -c "cd /home/github/actions-runner && ./svc.sh install github"
5164 - su - root -c "cd /home/github/actions-runner && ./svc.sh start"
0 commit comments