-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
91 lines (89 loc) · 3.37 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
additionalRepositories:
- url: https://github.com/SU-SWS/ace-stanfordlagunita/
checkoutLocation: back
checkoutLocation: front
ports:
- name: database
description: Mysql database
port: 3306
onOpen: ignore
visibility: private
- port: 33060
onOpen: ignore
visibility: private
- name: drupal
description: Drupal backend
port: 8001
onOpen: ignore
visibility: public
- name: frontend
description: NextJS frontend
port: 3000-3004
onOpen: ignore
visibility: public
- port: 8002-9999
onOpen: ignore
image: pookmish/drupal8ci:gitpod
tasks:
- name: Drupal Prep
init: >
eval $(gp env -e APACHE_DOCROOT_IN_REPO=../back/docroot) &&
cd /workspace/back &&
git checkout 2.x &&
composer install --no-interaction &&
mkdir -p blt &&
cp .gitpod/blt.yml blt/local.blt.yml &&
find docroot/sites/ -name 'local*' | xargs rm -rf &&
export NEXT_PUBLIC_DRUPAL_BASE_URL=`gp url 8001` &&
export PREVIEW_URL=${NEXT_PUBLIC_DRUPAL_BASE_URL#"https://"} &&
blt blt:telemetry:disable --no-interaction &&
blt settings &&
echo 'ssh: {options: "-o StrictHostKeyChecking=no"}' > drush/local.drush.yml &&
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa &&
blt drupal:sync --site=supress -n || blt drupal:install --site=supress -n
else
blt drupal:install --site=supress -n
fi &&
drush @supress.local cset system.theme default stanford_profile_admin_theme -y &&
cd /workspace/front &&
yarn
command: |
cp .env.example .env.local &&
gp ports await 3306 &&
eval $(gp env -e APACHE_DOCROOT_IN_REPO=../back/docroot) &&
cd /workspace/back &&
export NEXT_PUBLIC_DRUPAL_BASE_URL=`gp url 8001` &&
export PREVIEW_URL=${NEXT_PUBLIC_DRUPAL_BASE_URL#"https://"} &&
echo "<?php \$sites['$PREVIEW_URL'] = 'supress';" > docroot/sites/local.sites.php &&
blt settings &&
apache2ctl restart &&
gp ports await 8001 &&
drush @supress.local uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL &&
drush @supress.local uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL | xargs gp preview --external &&
git config core.fileMode false &&
drush @supress.local su-next-connect "$(gp url 3000)" >> /workspace/front/.env.local &&
cd /workspace/front &&
yarn install &&
yarn config set --home enableTelemetry 0 &&
yarn next telemetry disable &&
sed -i -r "s|NEXT_PUBLIC_DRUPAL_BASE_URL.*|NEXT_PUBLIC_DRUPAL_BASE_URL=$NEXT_PUBLIC_DRUPAL_BASE_URL|g" .env.local &&
yarn dev &
gp ports await 3000 &&
gp url 3000 | xargs gp preview --external
- name: SSH Keys
before: |
code --add /workspace/back &&
mkdir -p ~/.ssh
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa &&
git remote set-url origin $(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .repository.cloneUrl | sed -E 's|^.*.com/(.*)$|[email protected]:\1|') &&
cd /workspace/back && git remote set-url origin [email protected]:SU-SWS/ace-stanfordlagunita.git
fi
if [[ ! -z $GITCONFIG ]]; then
echo $GITCONFIG | base64 -d > ~/.gitconfig && chmod 644 ~/.gitconfig
fi
vscode:
extensions:
- bradlc.vscode-tailwindcss
- esbenp.prettier-vscode