-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Docs, and move scripts to dev-setup.
- Loading branch information
Showing
7 changed files
with
33 additions
and
179 deletions.
There are no files selected for viewing
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,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# First we should go home | ||
cd ~ | ||
cd ~/ | ||
|
||
# Add PostgreSQL's repository to your system: | ||
echo "Adding PostgreSQL's repository to your system..." | ||
|
@@ -33,14 +33,14 @@ rustup install stable | |
|
||
# Install Rust tools: | ||
echo "Installing Rust tools..." | ||
rustup component add rustfmt clippy | ||
rustup component add rustfmt clippy cargo-watch | ||
cargo install diesel_cli --no-default-features --features "postgres" | ||
|
||
# Clone Aardwolf: | ||
echo "Switching to home directory" | ||
cd ~/ | ||
echo "Cloning Aardwolf..." | ||
git clone git@github.com:Aardwolf-Social/aardwolf.git | ||
git clone https://github.com/aardwolf/aardwolf | ||
|
||
# Setup PostgreSQL | ||
echo "Setting up PostgreSQL..." | ||
|
@@ -49,26 +49,20 @@ sudo systemctl start postgresql.service | |
|
||
# Create the aardwolf database | ||
echo "Creating the aardwolf database..." | ||
sudo -u postgres psql -c "CREATE DATABASE aardwolf;" | ||
sudo -u postgres psql -c "CREATE DATABASE aardwolf_testing;" | ||
|
||
# Create the aardwolf database user | ||
echo "Creating the aardwolf database user..." | ||
sudo -u postgres psql -c "CREATE USER aardwolf_user WITH PASSWORD 'changeme';" | ||
sudo -u postgres psql -c "grant all privileges on database aardwolf_testing to aardwolf_user;" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE aardwolf TO aardwolf_user;" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE aardwolf_testing TO aardwolf_user;" | ||
|
||
# Set up environment variables for database URLs | ||
echo "Setting up environment variables..." | ||
echo "DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf_testing" > ~/aardwolf/.env | ||
echo "DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf" > ~/aardwolf/.env | ||
echo "TEST_DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf_testing" >> ~/aardwolf/.env | ||
|
||
# Set up diesel | ||
echo "Setting up diesel..." | ||
diesel setup | ||
|
||
# Run migrations | ||
echo "Running migrations" | ||
diesel migration run | ||
|
||
# Setup aardwolf | ||
echo "Setting up aardwolf..." | ||
cargo run --bin setup |
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,13 +1,5 @@ | ||
#!/bin/bash | ||
|
||
# Add PostgreSQL's repository to your system: | ||
echo "Adding PostgreSQL's repository to your system..." | ||
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
|
||
# Import the repository signing key: | ||
echo "Importing the PostgreSQL's repository signing key..." | ||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
|
||
# Update the package lists: | ||
echo "Updating package lists..." | ||
brew update | ||
|
@@ -16,6 +8,10 @@ brew update | |
echo "Installing PostgreSQL..." | ||
brew install postgres | ||
|
||
# Start PostgreSQL, and create default user: | ||
brew service start postgresql@15 | ||
/usr/local/opt/postgresql@15/bin/createuser -s postgres | ||
|
||
# Install Rust: | ||
echo "Installing Rust..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
@@ -24,6 +20,11 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
echo "Installing Rust stable toolchain..." | ||
rustup install stable | ||
|
||
# Set RUSTFLAGS to point linker to libpq | ||
echo "Setting RUSTFLAGS for libpq..." | ||
brew link postgresql@15 | ||
export RUSTFLAGS="-L/usr/local/opt/postgresql@15/lib" | ||
|
||
# Install Rust tools: | ||
echo "Installing Rust tools..." | ||
rustup component add rustfmt clippy | ||
|
@@ -33,29 +34,23 @@ cargo instal diesel_cli --no-default-features --features "postgres" | |
echo "Switching to home directory" | ||
cd ~/ | ||
echo "Cloning Aardwolf..." | ||
git clone git@github.com:Aardwolf-Social/aardwolf.git | ||
git clone https://github.com/aardwolf/aardwolf | ||
|
||
# Create the aardwolf database | ||
echo "Creating the aardwolf database..." | ||
sudo -u postgres psql -c "CREATE DATABASE aardwolf;" | ||
sudo -u postgres psql -c "CREATE DATABASE aardwolf_testing;" | ||
|
||
# Create the aardwolf database user | ||
echo "Creating the aardwolf database user..." | ||
sudo -u postgres psql -c "CREATE USER aardwolf_user WITH PASSWORD 'changeme';" | ||
sudo -u postgres psql -c "grant all privileges on database aardwolf_testing to aardwolf_user;" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE aardwolf TO aardwolf_user;" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE aardwolf_testing TO aardwolf_user;" | ||
|
||
# Set up environment variables for database URLs | ||
echo "Setting up environment variables..." | ||
echo "DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf_testing" > .env | ||
echo "TEST_DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf_testing" >> .env | ||
|
||
# Set up diesel | ||
echo "Setting up diesel..." | ||
diesel setup | ||
|
||
# Run migrations | ||
echo "Running migrations" | ||
diesel migration run | ||
echo "DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf" > ~/aardwolf/.env | ||
echo "TEST_DATABASE_URL=postgresql://aardwolf_user:[email protected]:5432/aardwolf_testing" >> ~/aardwolf/.env | ||
|
||
# Setup aardwolf | ||
echo "Setting up aardwolf..." | ||
|
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
File renamed without changes.
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.
This file was deleted.
Oops, something went wrong.