Skip to content

Commit

Permalink
add provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
dhairyadwivedi committed Jul 18, 2024
1 parent 8d8571d commit b61d2fd
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 6 deletions.
1 change: 1 addition & 0 deletions provisioning/clone/.crystallize
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
security file, to enforce that we don't remove wrong folders
3 changes: 3 additions & 0 deletions provisioning/clone/.env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CRYSTALLIZE_ACCESS_TOKEN_ID="##CRYSTALLIZE_ACCESS_TOKEN_ID##"
CRYSTALLIZE_ACCESS_TOKEN_SECRET="##CRYSTALLIZE_ACCESS_TOKEN_SECRET##"
CRYSTALLIZE_TENANT_IDENTIFIER="##CRYSTALLIZE_TENANT_IDENTIFIER##"
3 changes: 3 additions & 0 deletions provisioning/clone/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
User-agent: *

Allow: /
36 changes: 36 additions & 0 deletions provisioning/clone/setup.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "${SCRIPT}")
PROJECT_PATH=${SCRIPTPATH}/../..

console() {
echo -e ${PROJECT_PATH}
}

if [ ! -f "${PROJECT_PATH}/provisioning/clone/.crystallize" ]; then
echo "It does not seem to be a clean clone. Aborting."
exit 1
fi

# Note that Crystallize CLI is acting before this script.

echo "Setup ${PROJECT_PATH}"
cp ${PROJECT_PATH}/provisioning/clone/robots.txt ${PROJECT_PATH}/remix/robots.txt
cp ${PROJECT_PATH}/provisioning/clone/.env.dist ${PROJECT_PATH}/service-api/.env.dist

#---
echo "Running command ${PROJECT_PATH}"
cd ${PROJECT_PATH}/remix && cat ${PROJECT_PATH}/remix/.env.local.example <(echo) ${PROJECT_PATH}/remix/.env.dist > .env
cd ${PROJECT_PATH}/service-api && cat ${PROJECT_PATH}/service-api/.env.local.example <(echo) ${PROJECT_PATH}/service-api/.env.dist > .env
cd ${PROJECT_PATH}/remix && npm install --no-progress --no-color --legacy-peer-deps
cd ${PROJECT_PATH}/service-api && npm install --no-progress --no-color --legacy-peer-deps

#---

echo "Cleanup ${PROJECT_PATH}"

rm -rf ${PROJECT_PATH}/.github
rm -rf ${PROJECT_PATH}/.git
rm -rf ${PROJECT_PATH}/.vscode
rm -rf ${PROJECT_PATH}/provisioning/clone
2 changes: 2 additions & 0 deletions provisioning/clone/success.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Next Steps
Congratualions! Project has installed with success.
1 change: 1 addition & 0 deletions provisioning/tenant/spec.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions remix/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CRYSTALLIZE_TENANT_IDENTIFIER=
SERVICE_API_URL=
NODE_EXECUTION_MODE=
2 changes: 1 addition & 1 deletion remix/app/styles/tailwind.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions remix/start_with_migrations.sh

This file was deleted.

0 comments on commit b61d2fd

Please sign in to comment.