-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitpod.yml
34 lines (32 loc) · 1.83 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.
# To get livereloading working: https://www.gitpod.io/docs/introduction/languages/svelte#making-live-reload-work
tasks:
- name: Dev Server
init: |
npm install
npm install --prefix app/
command: |
git config --global --add --bool push.autoSetupRemote true
echo "Pulling down latest version of the current branch (if this is a new gitpod workspace that should be 'main')"
git pull
echo "Determing if a new gitpod-specific branch should be created, or if the current branch is already a gitpod-specific branch"
export CREATE_NEW_BRANCH=$([[ $(git rev-parse --abbrev-ref HEAD) = gitpod* ]] && echo false || echo true)
echo "If a new gitpod-specifc branch should be created, then:"
echo "(1) Create a name for the branch using the user's email and the current time stamp"
if $CREATE_NEW_BRANCH; then export PRG_BRANCH="$(date +gitpod/$(git config user.email | cut -d@ -f1)/%Y-%m-%d-%H-%M-%S)"; fi
echo "(2) Checkout the new branch"
if $CREATE_NEW_BRANCH; then git checkout -b $PRG_BRANCH; fi
echo "Creating an alias (i.e. shortcut command) to save all changes to git"
alias Save="git add . && git commit -m \"Automated commit from gitpod\" && git push"
echo "Creating an alias (i.e. shortcut command) to save all changes to git and stop the gitpod workspace"
alias SaveAndQuit="Save && gp stop"
echo "Creating an alias (i.e. shortcut command) to stop the gitpod workspace"
alias Quit="gp stop"
echo "Start dev server"
npm run gitpod:dev
openMode: 'split-right'
ports:
- port: 5173
onOpen: open-preview