File tree 6 files changed +14
-14
lines changed
6 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ services:
4
4
- docker
5
5
6
6
before_install :
7
- - pyenv global 2.7.14 # For removing SNIMissingWarning warnings
8
7
- pip install --user awscli
9
8
- export PATH=$PATH:$HOME/.local/bin
10
9
- curl -o $HOME/.local/bin/ecs-cli
Original file line number Diff line number Diff line change 11
11
docker build -t uneet/bugzilla-customisation .
12
12
13
13
down :
14
- docker-compose down
14
+ docker-compose down -v
15
15
16
16
pull :
17
17
docker-compose pull
Original file line number Diff line number Diff line change @@ -17,11 +17,8 @@ Requires [docker](https://www.docker.com/) &
17
17
18
18
# Developing locally
19
19
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.
25
22
26
23
The idea now is to start from a ** snapshot** of the remote development (dev)
27
24
environment. 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`
44
41
45
42
docker-compose up -d db # Just start the database at first, should be empty
46
43
# 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
48
45
make up
49
46
50
47
The 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 --
41
41
42
42
if test $AWS_PROFILE == uneet-localhost
43
43
then
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
45
46
else
46
47
export MYSQL_ROOT_PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
47
48
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
49
50
fi
Original file line number Diff line number Diff line change 40
40
AWS_PROFILE=uneet-$STAGE
41
41
shift " $(( OPTIND- 1 )) " # Discard the options and sentinel --
42
42
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)
44
45
export MYSQL_HOST=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_HOST --with-decryption --query Parameters[0].Value --output text)
45
46
echo 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)
48
48
MYSQL_PASSWORD=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_ROOT_PASSWORD --with-decryption --query Parameters[0].Value --output text)
49
49
MYSQL_USER=$( aws --profile $AWS_PROFILE ssm get-parameters --names MYSQL_USER --with-decryption --query Parameters[0].Value --output text)
50
50
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