Skip to content
Snippets Groups Projects
Commit c6c02421 authored by Damien Eichhorn's avatar Damien Eichhorn :computer:
Browse files

add gitpod

parent 20652774
Branches
No related tags found
No related merge requests found
image: gitpod/workspace-mysql
ports:
- port: 3000
onOpen: ignore
visibility: public
tasks:
- name: tailscaled
command: |
if [ -n "${TAILSCALE_STATE_GITPOD_TESTREPO}" ]; then
# restore the tailscale state from gitpod user's env vars
sudo mkdir -p /var/lib/tailscale
echo "${TAILSCALE_STATE_GITPOD_TESTREPO}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
fi
sudo tailscaled
- name: tailscale
command: |
if [ -n "${TAILSCALE_STATE_GITPOD_TESTREPO}" ]; then
sudo -E tailscale up
else
sudo -E tailscale up --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_GITPOD_TESTREPO="$(sudo cat /var/lib/tailscale/tailscaled.state)"
fi
- name: Start application
before: |
if [ ! -f ".env" ]; then
cp .env.gitpod .env
fi
init: |
eval $(gp env -e)
npm install
command: |
mysql -u root -e "CREATE DATABASE IF NOT EXISTS gitpod_testrepo"
API_BASE_URL=3000-$GITPOD_WORKSPACE_ID.$GITPOD_WORKSPACE_CLUSTER_HOST npm run start:dev
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment