Skip to content

Commit

Permalink
SUP-126 Setup gitpod with backend repo (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Mar 27, 2024
1 parent 03c0e79 commit 1fc4bb3
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 255 deletions.
41 changes: 19 additions & 22 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

additionalRepositories:
- url: https://github.com/SU-SWS/acsf-cardinalsites-public
- url: https://github.com/SU-SWS/ace-stanfordlagunita/
checkoutLocation: back
checkoutLocation: front
ports:
Expand Down Expand Up @@ -37,14 +37,12 @@ tasks:
mkdir -p blt &&
cp .gitpod/blt.yml blt/local.blt.yml &&
find docroot/sites/ -name 'local*' | xargs rm -rf &&
cp .gitpod/global.settings.php docroot/sites/settings/global.settings.php &&
cp .gitpod/default.local.services.yml docroot/sites/local.services.yml &&
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 &&
blt drupal:install -n &&
drush cset system.theme default claro -y &&
blt drupal:install --site=supress -n &&
drush @supress.local cset system.theme default stanford_profile_admin_theme -y &&
cd /workspace/front &&
cp .env.example .env.local &&
sed -i 's/#DRUPAL_REVALIDATE_SECRET/DRUPAL_REVALIDATE_SECRET/' .env.local &&
Expand All @@ -59,38 +57,37 @@ tasks:
find docroot -name 'local.drush.yml' | xargs rm &&
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 blt:telemetry:disable --no-interaction &&
echo 'Establishing Settings' &&
blt settings &&
echo 'Logging Into Drupal' &&
drush uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL &&
drush uli --uri=$NEXT_PUBLIC_DRUPAL_BASE_URL | xargs gp preview --external &&
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 &&
echo 'Connecting Drupal to Frontend' &&
drush su-next-connect "$(gp url 3000)" --preview-secret=DRUPAL_PREVIEW_SECRET --revalidation-secret=DRUPAL_REVALIDATION_SECRET &&
drush @supress.local su-next-connect "$(gp url 3000)" --preview-secret=DRUPAL_PREVIEW_SECRET --revalidation-secret=DRUPAL_REVALIDATION_SECRET &&
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
command: |
rm -rf ~/.ssh/id_rsa &&
rm -rf ~/.ssh/id_rsa.pub &&
eval $(command gp env -e) &&
mkdir -p ~/.ssh &&
[[ ! -z $SSH_PUBLIC_KEY ]] &&
echo $SSH_PUBLIC_KEY | base64 -d > ~/.ssh/id_rsa.pub &&
chmod 644 ~/.ssh/id_rsa.pub &&
[[ ! -z $SSH_PRIVATE_KEY ]] &&
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa &&
chmod 600 ~/.ssh/id_rsa &&
cd /workspace/front &&
[[ ! -z $GITCONFIG ]] &&
echo $GITCONFIG | base64 -d > ~/.gitconfig &&
chmod 644 ~/.gitconfig
git remote set-url origin $(echo $GITPOD_WORKSPACE_CONTEXT | jq -r .repository.cloneUrl | sed -E 's|^.*.com/(.*)$|git@github.com:\1|')
mkdir -p ~/.ssh
if [[ ! -z $SSH_PUBLIC_KEY ]]; then
echo $SSH_PUBLIC_KEY | base64 -d > ~/.ssh/id_rsa.pub && chmod 644 ~/.ssh/id_rsa.pub
fi
if [[ ! -z $SSH_PRIVATE_KEY ]]; then
echo $SSH_PRIVATE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
fi
if [[ ! -z $GITCONFIG ]]; then
echo $GITCONFIG | base64 -d > ~/.gitconfig && chmod 644 ~/.gitconfig
fi
vscode:
extensions:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@next/third-parties": "^14.1.4",
"@tailwindcss/container-queries": "^0.1.1",
"@types/node": "^20.11.30",
"@types/react": "^18.2.72",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.22",
"algoliasearch": "^4.23.1",
"algoliasearch": "^4.23.2",
"autoprefixer": "^10.4.19",
"axios": "^1.6.8",
"clsx": "^2.1.0",
Expand All @@ -35,7 +35,7 @@
"graphql-tag": "^2.12.6",
"html-entities": "^2.5.2",
"html-react-parser": "^5.1.9",
"next": "^14.2.0-canary.43",
"next": "^14.2.0-canary.45",
"next-drupal": "^1.6.0",
"postcss": "^8.4.38",
"qs": "^6.12.0",
Expand All @@ -47,7 +47,7 @@
"react-tiny-oembed": "^1.1.0",
"sharp": "^0.33.3",
"tailwind-merge": "^2.2.2",
"tailwindcss": "^3.4.1",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3",
"usehooks-ts": "^3.0.2"
},
Expand Down
Loading

0 comments on commit 1fc4bb3

Please sign in to comment.