File tree Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Expand file tree Collapse file tree 6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ services:
44 - docker
55
66before_install :
7- - pyenv global 2.7.14 # For removing SNIMissingWarning warnings
87 - pip install --user awscli
98 - export PATH=$PATH:$HOME/.local/bin
109 - curl -o $HOME/.local/bin/ecs-cli
Original file line number Diff line number Diff line change 1111 docker build -t uneet/bugzilla-customisation .
1212
1313down :
14- docker-compose down
14+ docker-compose down -v
1515
1616pull :
1717 docker-compose pull
Original file line number Diff line number Diff line change @@ -17,11 +17,8 @@ Requires [docker](https://www.docker.com/) &
1717
1818# Developing locally
1919
20- We used to start from a prime sql, but that had a couple of drawbacks:
21-
22- * The prime sql schema was often out of date or unused/untested
23- * When starting from scratch, you had to manually create users ` Accounts.createUser ` to sync the [ Frontend] ( https://github.com/unee-t/frontend )
24- * The dev environment is more likely to have an existing / interesting bug state to be fixed locally
20+ We used to start from a [ prime sql] ( https://github.com/unee-t/bz-database ) , but
21+ now we being from existing development snapshots.
2522
2623The idea now is to start from a ** snapshot** of the remote development (dev)
2724environment. Our remote dev environment is hosted on AWS and so are all the
@@ -44,7 +41,7 @@ Make sure your local .env is correctly setup with `./env-setup.bash`
4441
4542 docker-compose up -d db # Just start the database at first, should be empty
4643 # Restore dev snapshot
47- mysql -h 127.0.0.1 -P 3306 -u root --password=$MYSQL_ROOT_PASSWORD bugzilla < dev-backup.sql
44+ mysql -h db -P 3306 -u root --password=$MYSQL_ROOT_PASSWORD bugzilla < dev-backup.sql
4845 make up
4946
5047The dashboard administrator username / password is:
Original file line number Diff line number Diff line change @@ -41,9 +41,10 @@ shift "$((OPTIND-1))" # Discard the options and sentinel --
4141
4242if test $AWS_PROFILE == uneet-localhost
4343then
44- echo mongorestore -h 127.0.0.1 --drop --port 27017 $dir
44+ export MYSQL_ROOT_PASSWORD=$( aws --profile uneet-dev ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
45+ echo mysqldump -B -R -h 127.0.0.1 -P 3306 -u root --password=$MYSQL_ROOT_PASSWORD bugzilla
4546else
4647 export MYSQL_ROOT_PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
4748 export MYSQL_HOST=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_HOST --with-decryption --query Parameters[0].Value --output text)
48- mysqldump --single-transaction --skip-lock-tables --ignore-table=bugzilla.attach_data --column-statistics=0 -R -h $MYSQL_HOST -P 3306 -u root --password=$MYSQL_ROOT_PASSWORD bugzilla > $STAGE -backup-$( date +%s) .sql
49+ mysqldump -B - -single-transaction --skip-lock-tables --ignore-table=bugzilla.attach_data --column-statistics=0 -R -h $MYSQL_HOST -P 3306 -u root --password=$MYSQL_ROOT_PASSWORD bugzilla > $STAGE -backup-$( date +%s) .sql
4950fi
Original file line number Diff line number Diff line change 4040AWS_PROFILE=uneet-$STAGE
4141shift " $(( OPTIND- 1 )) " # Discard the options and sentinel --
4242
43- export PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names unee_t_root-Password --with-decryption --query Parameters[0].Value --output text)
43+ # export PASSWORD=$(aws --profile $AWS_PROFILE ssm get-parameters --names unee_t_root-Password --with-decryption --query Parameters[0].Value --output text)
44+ export PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
4445export MYSQL_HOST=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_HOST --with-decryption --query Parameters[0].Value --output text)
4546echo Restoring $1 to $MYSQL_HOST
46- mysql -h $MYSQL_HOST -P 3306 -u unee_t_root --password=$PASSWORD bugzilla < $1
47-
47+ mysql -h $MYSQL_HOST -P 3306 -u root --password=$PASSWORD bugzilla < $1
48+ # mysql -h $MYSQL_HOST -P 3306 -u unee_t_root --password=$PASSWORD bugzilla < $1
Original file line number Diff line number Diff line change @@ -48,4 +48,6 @@ echo Connecting to ${STAGE^^} $(domain $STAGE)
4848MYSQL_PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
4949MYSQL_USER=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_USER --with-decryption --query Parameters[0].Value --output text)
5050
51- echo mysql -h $( domain $STAGE ) -P 3306 -u root --password=$MYSQL_PASSWORD bugzilla
51+ echo $STAGE
52+ echo mysql -s -h $( domain $STAGE ) -P 3306 -u root --password=$MYSQL_PASSWORD bugzilla
53+ mysql -s -h $( domain $STAGE ) -P 3306 -u root --password=$MYSQL_PASSWORD bugzilla
You can’t perform that action at this time.
0 commit comments