Skip to content

Commit

Permalink
feat: add ContentaCMS setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Oct 25, 2021
1 parent e9313ab commit 12d26ff
Show file tree
Hide file tree
Showing 33 changed files with 71 additions and 11,950 deletions.
134 changes: 2 additions & 132 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,132 +1,2 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# VSCode
.vscode/*
# VSCode Xdebug settings
!.vscode/launch.json

# Intellij idea
*.iml
.idea

# OSX
.DS_Store
.AppleDouble
.LSOverride

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
CHANGELOG.md
contenta
download-contentacms.sh
6 changes: 3 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ image:

tasks:
- init: |
# Installing DDev and Drupal backend.
# Installing DDev and ContentaCMS backend.
.gitpod/scripts/ddev-download-images.sh
.gitpod/scripts/ddev-setup.sh
.gitpod/scripts/drupal-setup.sh
.gitpod/scripts/contenta-download.sh
.gitpod/scripts/contenta-setup.sh
# Installing Nuxt/Druxt frontend.
.gitpod/scripts/nuxt-setup.sh
command: |
Expand Down
9 changes: 9 additions & 0 deletions .gitpod/scripts/contenta-download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu -o pipefail

CONTENTA_DIR="${GITPOD_REPO_ROOT}/contenta"

# Download contenta
php -r "readfile('https://raw.githubusercontent.com/contentacms/contenta_jsonapi_project/8.x-2.x/scripts/download.sh');" > download-contentacms.sh
chmod a+x download-contentacms.sh
./download-contentacms.sh $CONTENTA_DIR
23 changes: 23 additions & 0 deletions .gitpod/scripts/contenta-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eu -o pipefail

CONTENTA_DIR="${GITPOD_REPO_ROOT}/contenta"

# Set up DDEV
cd "$GITPOD_REPO_ROOT" && .gitpod/scripts/ddev-setup.sh

# Setup Contenta
echo "\$settings['config_sync_directory'] = 'profiles/contrib/contenta_jsonapi/config/sync';" >> "$CONTENTA_DIR/web/sites/default/settings.php"
cd "$CONTENTA_DIR" && ddev drush si -y --account-pass=admin --site-name='quickstart-druxt-site-contenta' contenta_jsonapi

# Setup Druxt
cd "$CONTENTA_DIR" && ddev composer require drupal/druxt && ddev drush -y en druxt
cd "$CONTENTA_DIR" && ddev drush "rap anonymous 'access druxt resources'"
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.entity_form_display--entity_form_display
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.entity_form_mode--entity_form_mode
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.entity_view_display--entity_view_display
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.entity_view_mode--entity_view_mode
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.field_config--field_config
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.jsonapi_resource_config--jsonapi_resource_config
cd "$CONTENTA_DIR" && ddev drush cdel jsonapi_extras.jsonapi_resource_config.view--view
cd "$CONTENTA_DIR" && ddev drush cr
30 changes: 25 additions & 5 deletions .gitpod/scripts/ddev-setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
#!/usr/bin/env bash

# Set up ddev for use on gitpod
DRUPAL_DIR="${GITPOD_REPO_ROOT}/drupal"
DDEV_DIR="${DRUPAL_DIR}/.ddev"

set -eu -o pipefail

DDEV_DIR="${GITPOD_REPO_ROOT}/contenta/.ddev"
mkdir -p "$DDEV_DIR"

cat <<CONFIGEND > "${DDEV_DIR}"/config.yaml
#gitpod-generated
name: quickstart-druxt-site-contenta
type: drupal9
docroot: web
php_version: "7.4"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.3"
mysql_version: ""
use_dns_when_possible: true
composer_version: ""
web_environment: []
CONFIGEND

# Generate a config.gitpod.yaml that adds the gitpod
# proxied ports so they're known to ddev.
Expand Down Expand Up @@ -41,5 +62,4 @@ COMPOSEEND
# Misc housekeeping before start
ddev config global --instrumentation-opt-in=true --omit-containers=ddev-router

# Start ddev
cd $DRUPAL_DIR && ddev start
cd "$DDEV_DIR" && ddev start
11 changes: 0 additions & 11 deletions .gitpod/scripts/drupal-setup.sh

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# DruxtSite quickstart - Drupal
# DruxtSite quickstart - ContentaCMS

> One click, Fully Decoupled Drupal Site starter-kit with Druxt.
> One click, Fully Decoupled ContentaCMS Site starter-kit with Druxt.
DruxtSite connects Drupal to Nuxt via JSON:API to provide a framework for building a Fully Decoupled site.

This repostory provides a quickstart installation of:
- Drupal 9
- ContentaCMS
- Nuxt 2
- DruxtSite

Expand All @@ -14,7 +14,7 @@ This repostory provides a quickstart installation of:

Try it before you fork it:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/druxt/quickstart-druxt-site)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/druxt/quickstart-druxt-site-contentacms)


## Getting started
Expand All @@ -23,7 +23,7 @@ Try it before you fork it:

2. Once the repository has been generated, open it in Gitpod by appending `https://gitpod.io#` to the GitHub url.

Example: `https://gitpod.io#github.com/druxt/quickstart-druxt-site`
Example: `https://gitpod.io#github.com/druxt/quickstart-druxt-site-contentacms`

_Note:_ If this is your first time using Gitpod, you can signup for a free plan with your Github account.

Expand All @@ -34,7 +34,7 @@ Try it before you fork it:

## How to use it

Your environment contains a pre-install, pre-configured and running instance of Drupal and Nuxt, with the DruxtSite module enabled.
Your environment contains a pre-install, pre-configured and running instance of ContentaCMS and Nuxt, with the DruxtSite module enabled.

You can access the services in your browser, via the **Remote Explorer** extension, or via the URL pattern: `https://[PORT]-[GITPOD_ID].[GITPOD_SERVER].gitpod.io`

Expand All @@ -45,7 +45,7 @@ You can access the services in your browser, via the **Remote Explorer** extensi
| -- | -- |
| `3000` | Nuxt.js |
| `3003` | Storybook |
| `8080` | Drupal |
| `8080` | ContentaCMS |


## Tools
Expand All @@ -71,4 +71,4 @@ To start Storybook, navigate to the `nuxt` directory and run `npx nuxt storybook

## License

[MIT](https://github.com/druxt/druxt.js/blob/develop/LICENSE)
[MIT](https://github.com/druxt/quickstart-druxt-site-contentacms/blob/develop/LICENSE)
Loading

0 comments on commit 12d26ff

Please sign in to comment.