diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..64dd3d82 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,92 @@ + +additionalRepositories: + - url: https://github.com/SU-SWS/acsf-cardinalsites-public + checkoutLocation: back +checkoutLocation: front +github: + prebuilds: + master: true + branches: false + pullRequests: true + pullRequestsFromForks: false + addCheck: false + addComment: false + addBadge: true +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 + onOpen: ignore + visibility: public + - port: 8002-9999 + onOpen: ignore +image: pookmish/drupal8ci:gitpod +tasks: + - name: Drupal Prep + init: > + cp .gitpod/blt.yml /workspace/back/blt/local.blt.yml && + cd /workspace/back && + export NEXT_PUBLIC_DRUPAL_BASE_URL=`gp url 8001` && + export PREVIEW_URL=${NEXT_PUBLIC_DRUPAL_BASE_URL#"https://"} && + git checkout composer.* && + composer install --no-interaction && + blt blt:telemetry:disable --no-interaction && + blt settings && + blt drupal:install -n + command: | + cd /workspace/back && + echo 'Restarting Apache' && + apache2ctl restart && + gp ports await 8001 && + 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://"} && + 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 && + git config core.fileMode false && + echo 'Connecting Drupal to Frontend' && + cd /workspace/front && + yarn install && + 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 $GITPOD_REPO_ROOT && + git remote set-url origin git@github.com:SU-SWS/ace-sulgryphon.git && + cd frontend && + git remote set-url origin git@github.com:SU-SWS/sulgryphon-nextjs.git && + [[ ! -z $GITCONFIG ]] && + echo $GITCONFIG | base64 -d > ~/.gitconfig && + chmod 644 ~/.gitconfig + +vscode: + extensions: + - bradlc.vscode-tailwindcss \ No newline at end of file diff --git a/.gitpod/blt.yml b/.gitpod/blt.yml new file mode 100644 index 00000000..e977cd99 --- /dev/null +++ b/.gitpod/blt.yml @@ -0,0 +1,13 @@ +drupal: + account: + mail: sws-developers@lists.stanford.edu + db: + port: 3306 + host: localhost + username: root + password: '' + database: 'drupal' +project: + local: + protocol: https + hostname: '${env.PREVIEW_URL}' \ No newline at end of file