Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cookiecutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default_context:
project_name: "demo"
project_slug: "demo"
project_generated_name: "demo"
owner_email: "demo@crowdbotics.com"
custom_domain: "demo.botics.co"
repo_url: "https://github.com/crowdbotics/modules"
heroku_dyno_size: "free"
heroku_team: ""
is_mobile: "y"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scaffold": {
"type": "react-native",
"version": "2.7.0",
"version": "2.7.1",
"cookiecutter_context": {
"project_name": "{{cookiecutter.project_name}}",
"project_slug": "{{cookiecutter.project_slug}}",
Expand Down
4 changes: 2 additions & 2 deletions dist/cookie/{{cookiecutter.project_slug}}/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crowdbotics/cb-django:3.8-slim-buster AS build
FROM crowdbotics/cb-django:3.9-slim-buster AS build

# Copy dependency management files and install app packages to /.venv
COPY backend/Pipfile backend/Pipfile.lock /
Expand All @@ -11,7 +11,7 @@ COPY . .
RUN yarn install && yarn run web:build


FROM crowdbotics/cb-django:3.8-slim-buster AS release
FROM crowdbotics/cb-django:3.9-slim-buster AS release
ARG SECRET_KEY

# Set Working directory
Expand Down
Binary file added dist/react-native-demo.zip
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"semver": "node scripts/semver.js",
"cookie": "node scripts/cookie.js",
"demo": "node scripts/demo.js",
"raw": "node scripts/raw.js",
"template": "node scripts/template.js",
"bootstrap": "npm run raw; npm run cookie",
Expand Down
2 changes: 1 addition & 1 deletion scaffold/template/custom/.crowdbotics.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scaffold": {
"type": "react-native",
"version": "2.7.0",
"version": "2.7.1",
"cookiecutter_context": {
"project_name": "{{cookiecutter.project_name}}",
"project_slug": "{{cookiecutter.project_slug}}",
Expand Down
4 changes: 2 additions & 2 deletions scaffold/template/custom/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crowdbotics/cb-django:3.8-slim-buster AS build
FROM crowdbotics/cb-django:3.9-slim-buster AS build

# Copy dependency management files and install app packages to /.venv
COPY backend/Pipfile backend/Pipfile.lock /
Expand All @@ -11,7 +11,7 @@ COPY . .
RUN yarn install && yarn run web:build


FROM crowdbotics/cb-django:3.8-slim-buster AS release
FROM crowdbotics/cb-django:3.9-slim-buster AS release
ARG SECRET_KEY

# Set Working directory
Expand Down
33 changes: 33 additions & 0 deletions scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import path from "path";
import { execSync } from "child_process";
import fs from "fs";

const demoPath = path.join(process.cwd(), "demo");

const options = {
encoding: "utf8",
stdio: "inherit",
cwd: path.dirname(demoPath)
};
const yaml = path.join(process.cwd(), "cookiecutter.yaml");

function removeDir(dir) {
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true });
}
}

removeDir(demoPath);

const rnCookieCutterCommand = [
"pipenv run cookiecutter",
"./dist/cookie",
`--config-file ${yaml}`,
"--no-input"
].join(" ");

execSync(rnCookieCutterCommand, options);

execSync(`cd ${demoPath} && zip -r ../dist/react-native-demo.zip .`, options);

removeDir(demoPath);