Skip to content

Commit

Permalink
provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBox325 committed Feb 21, 2022
1 parent 1846ddc commit 3f4b6b0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 31 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Install the wrapper with `npm i`.
#### Project Setup
Install all project dependencies and configure the project with `npm run setup`.

#### Provision CraftCMS and Nitro
Firstly make a new `_craft` directory and cd into it then run `composer create-project JayBox325/JayCraft .` to install a CraftCMS project in here.

Set up a CraftCMS Security Key with `./craft setup/security-key`.

Add this project to Nitro (provided you have it installed and setup on your machine) with `nitro add`.

### Shopify

`theme open -e development` Open the development theme in the browser.
Expand Down
4 changes: 2 additions & 2 deletions _frontend/project.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const projectConfig = {
name: 'lagoon',
name: 'test',
framework: 'craft', // static, craft or shopify
domain: 'local.lagoon.com',
domain: 'local.test.com',
init: true
}

Expand Down
65 changes: 36 additions & 29 deletions _setup/provision.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import inquirer from 'inquirer'
import run from './run.js'
import { exec } from 'child_process'
import projectConfig from '../_frontend/project.config.js'

async function provision(options) {
Expand All @@ -25,7 +26,6 @@ async function provision(options) {
])
.then((answers) => {
if (answers.provision) {
console.log(answers.framework)
switch (answers.framework) {
case 'Shopify':
run('mkdir', ['_shopify'])
Expand All @@ -35,53 +35,60 @@ async function provision(options) {
case 'Craft':
Promise.resolve()

// THIS IS IN PROGRESS, BUT cd-ing into ./_craft doesn't work

// Make Craft directory
.then(() =>
run('mkdir', ['_craft'])
.then(() =>
run('take', ['_craft'])
)

// Create project from scaffold repo
.then(() =>
run('composer', ['create-project', 'JayBox325/JayCraft', '_craft'])
)
// // CD into _craft
// .then(() =>
// exec('_craft', function (error, stdout, stderr) {
// if (error) {
// console.error(`exec error: ${error}`);
// return;
// }
// })
// )

// CD into _craft
.then(() =>
run('cd', ['_craft'])
)
// // Create project from scaffold repo
// .then(() =>
// run('composer', ['create-project', 'JayBox325/JayCraft', '.'])
// )

// Create security key
.then(() =>
run('php', ['craft', 'setup/security-key'])
)
// // Create security key
// .then(() =>
// run('php', ['craft', 'setup/security-key'])
// )

// Build in Nitro
.then(() =>
run('nitro', ['add'])
)
// .then(() =>
// run('nitro', ['db', 'import', 'DATABASE FILE'])
// )
// // Build in Nitro
// .then(() =>
// run('nitro', ['add'])
// )
// .then(() =>
// run('nitro', ['db', 'import', 'DATABASE FILE'])
// )
break;

case 'Static':
run('mkdir', ['_build'])
console.log('Move Nunjucks into _src')
break;

default:
break;
}
}
})
.catch((error) => console.log(error))

/*
- Setup local project based on framework choice
- download and setup jaycraft for craftcms
- download and setup themekit for shopify
- move the nunjucks directory into _frontend for static
*/
/*
- Setup local project based on framework choice
- download and setup jaycraft for craftcms
- download and setup themekit for shopify
- move the nunjucks directory into _frontend for static
*/
})
}

Expand Down

0 comments on commit 3f4b6b0

Please sign in to comment.