add gitpod.yml
This commit is contained in:
parent
bf8d2d621e
commit
1610ec0e57
2 changed files with 119 additions and 0 deletions
41
.gitpod.yml
Normal file
41
.gitpod.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
# build the docker image for our gitpod from this dockerfile
|
||||
image:
|
||||
file: .gitpod.dockerfile
|
||||
# where gitpod should place our workspace (relative to /workspace)
|
||||
workspaceLocation: "."
|
||||
# all init+before are run in prebuilds, and on workspace startup
|
||||
tasks:
|
||||
- name: tailscaled
|
||||
command: |
|
||||
if [ -n "$TAILSCALE_AUTHKEY" ]; then
|
||||
if [ -n "${TAILSCALE_STATE_MYPROJECT}" ]; then
|
||||
# restore the tailscale state from gitpod user's env vars
|
||||
sudo mkdir -p /var/lib/tailscale
|
||||
echo "${TAILSCALE_STATE_MYPROJECT}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
|
||||
fi
|
||||
sudo tailscaled
|
||||
fi
|
||||
- name: tailscale
|
||||
command: |
|
||||
cd /workspace/guardianproject-ops/meta/
|
||||
if [ -n "$TAILSCALE_AUTHKEY" ]; then
|
||||
if [ -n "${TAILSCALE_STATE_MYPROJECT}" ]; then
|
||||
sudo -E tailscale up --authkey=${TAILSCALE_AUTHKEY}
|
||||
else
|
||||
sudo -E tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname "gitpod-${GITPOD_GIT_USER_NAME// /-}-$(echo ${GITPOD_WORKSPACE_CONTEXT} | jq -r .repository.name)"
|
||||
# store the tailscale state into gitpod user
|
||||
gp env TAILSCALE_STATE_MYPROJECT="$(sudo cat /var/lib/tailscale/tailscaled.state)"
|
||||
fi
|
||||
fi
|
||||
# extra extensions we share
|
||||
vscode:
|
||||
extensions:
|
||||
- redhat.vscode-yaml
|
||||
- ms-azuretools.vscode-docker
|
||||
- ms-kubernetes-tools.vscode-kubernetes-tools
|
||||
- ms-vscode.makefile-tools
|
||||
- bungcip.better-toml
|
||||
- sleistner.vscode-fileutils
|
||||
- esbenp.prettier-vscode
|
||||
- darkriszty.markdown-table-prettify
|
||||
Loading…
Add table
Add a link
Reference in a new issue