This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* simplfy docker remove testdata scripts * set node_env * add redis * add ability to restore data * update to node 8 * Fixed anon_db script for dojo leads
- Loading branch information
1 parent
69a1ee7
commit ed0a89c
Showing
18 changed files
with
160 additions
and
2,316 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ workspace-zen/* | |
!workspace-zen/.gitkeep | ||
npm-debug.log | ||
*.log* | ||
cd-db/dumps/* | ||
!cd-db/dumps/.gitkeep |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
FROM postgres:alpine | ||
MAINTAINER butlerx <butlerx@notthe.cloud> | ||
|
||
ADD setup_zen.sh /docker-entrypoint-initdb.d/10-setup_zen.sh | ||
FROM postgres:9-alpine | ||
LABEL maintainer="butlerx <cian@coderdojo.org>" | ||
RUN mkdir -p /db && chown -R postgres:postgres /db | ||
VOLUME /db | ||
COPY setup_zen.sql /docker-entrypoint-initdb.d/10-setup_zen.sql | ||
COPY restore_db.sh /docker-entrypoint-initdb.d/20-restore_db.sh | ||
COPY anon_db.sql /docker-entrypoint-initdb.d/30-anon_db.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
\c cp-users-development | ||
UPDATE sys_user SET | ||
salt='6a43b460', | ||
pass='8d8537a931321e9c1fbcc493da36b09888338d4615341016498fd40926b7e115f77c8676f6c06e391415265688658f1d8380bc6f9b45cd33572479e04ec1246f'; | ||
UPDATE sys_user set email = 'testmail+user' || id || '@example.com'; | ||
UPDATE sys_user set nick = email; | ||
UPDATE sys_user SET | ||
nick = 'NameyFace' , | ||
name = 'Namey McNameFace' , | ||
first_name = 'Namey' , | ||
last_name = 'McNameFace' , | ||
phone = translate(phone, '0123456789','9999999999'); | ||
TRUNCATE cd_oauth2; | ||
UPDATE cd_profiles SET name = 'Namey McNameFace'; | ||
UPDATE cd_profiles SET email = 'testmail+user' || user_id || '@example.com'; | ||
UPDATE cd_profiles SET alias = 'NameyFace'; | ||
UPDATE cd_profiles SET | ||
address = '123 Fake St., Over There Ave., End of the Road', | ||
phone = translate(phone, '0123456789','9999999999'); | ||
UPDATE cd_profiles SET avatar = NULL, parent_invites = NULL, ninja_invites = NULL, twitter = NULL, linkedin = NULL; | ||
UPDATE sys_login SET email = 'testmail+user' || sys_login.user || '@example.com', token = NULL; | ||
UPDATE sys_login SET nick = email; | ||
UPDATE sys_reset SET nick = 'testmail+user' || sys_reset.user || '@example.com'; | ||
UPDATE cd_agreements SET full_name='Namey McNameFace', ip_address='127.0.0.1'; | ||
|
||
\c cp-dojos-development | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, email}'::text[], ('"testmail+user' || user_id || '@example.com"')::jsonb); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, twitter}'::text[], '"example"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, firstName}'::text[], '"Namey"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, lastName}'::text[], '"McNameFace"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, dob}'::text[], '"1980-01-01T00:00:00.000Z"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, phone}'::text[], '"1234567890"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{champion, linkedIn}'::text[], '"linkedIn"'); | ||
UPDATE cd_dojoleads SET application = jsonb_set(application::jsonb, '{charter, fullName}'::text[], '"Namey McNameFace"'); | ||
UPDATE cd_dojoleads SET email = 'testmail+user' || user_id || '@example.com'; | ||
UPDATE cd_dojos SET creator_email = 'testmail+user' || creator || '@example.com'; | ||
UPDATE cd_dojos SET user_invites = NULL; | ||
|
||
\c cp-events-development | ||
UPDATE cd_applications SET name = 'test' || user_id || 'user'; | ||
UPDATE cd_applications SET notes = 'Some notes about the application' WHERE notes != ''; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
# To restore the a database place the tar.gz in the dump folder | ||
# they should be called users.tar.gz, dojos.tar.gz and events.tar.gz | ||
|
||
restore() { | ||
repo=$1 | ||
DUMP="/db/${repo}.tar.gz" | ||
if [ -f "$DUMP" ]; then | ||
echo restoring "$DUMP" | ||
mkdir -p /db/"$repo" | ||
tar xvf "$DUMP" -C /db/"$repo" | ||
pg_restore -c --if-exists -w -d "cp-${repo}-development" -U platform /db/"$repo"/backup_dump | ||
fi | ||
} | ||
|
||
restore users | ||
restore dojos | ||
restore events |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
create user platform with superuser password 'QdYx3D5y'; | ||
CREATE DATABASE "cp-dojos-development" OWNER platform; | ||
CREATE DATABASE "cp-users-development" OWNER platform; | ||
CREATE DATABASE "cp-events-development" OWNER platform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.