chore: remove redundant sqlx command (#22)
* chore: remove redundant sqlx command * chore: remove docker_env.sh * chore: copy sqlx to docker * chore update
This commit is contained in:
parent
186ce6c5af
commit
7a09e1b860
|
|
@ -61,6 +61,4 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||||
cargo sqlx database create
|
|
||||||
cargo sqlx migrate run
|
|
||||||
cargo test
|
cargo test
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ jobs:
|
||||||
- name: Install Development Dependencies
|
- name: Install Development Dependencies
|
||||||
run: |
|
run: |
|
||||||
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
cargo install sqlx-cli --version=${{ env.SQLX_VERSION }} --features ${{ env.SQLX_FEATURES }} --no-default-features --locked
|
||||||
cargo sqlx database create
|
|
||||||
cargo sqlx migrate run
|
|
||||||
|
|
||||||
- name: Check sqlx-data.json
|
- name: Check sqlx-data.json
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -44,4 +42,4 @@ jobs:
|
||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
|
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: SQLX_OFFLINE=true cargo clippy -- -D warnings
|
run: SQLX_OFFLINE=true cargo clippy -- -D warnings
|
||||||
13
Makefile
13
Makefile
|
|
@ -1,18 +1,7 @@
|
||||||
ROOT = "./build"
|
ROOT = "./build"
|
||||||
SEMVER_VERSION=$(shell grep version Cargo.toml | awk -F"\"" '{print $$2}' | head -n 1)
|
SEMVER_VERSION=$(shell grep version Cargo.toml | awk -F"\"" '{print $$2}' | head -n 1)
|
||||||
|
|
||||||
.PHONY: prerequisite local_test
|
.PHONY: run test
|
||||||
|
|
||||||
prerequisite:
|
|
||||||
POSTGRES_PORT=5432 ${ROOT}/init_database.sh
|
|
||||||
${ROOT}/init_redis.sh
|
|
||||||
|
|
||||||
appflowy_cloud_image:
|
|
||||||
source $(ROOT)/docker_env.sh && docker-compose up -d appflowy_cloud
|
|
||||||
|
|
||||||
local_test:
|
|
||||||
# 🔥 Must run init_database first
|
|
||||||
SQLX_OFFLINE=true cargo test
|
|
||||||
|
|
||||||
run:
|
run:
|
||||||
${ROOT}/run_local_server.sh
|
${ROOT}/run_local_server.sh
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
export BACKEND_VERSION="v0.0.1"
|
|
||||||
|
|
||||||
export POSTGRES_USER=postgres
|
|
||||||
export POSTGRES_PASSWORD=password
|
|
||||||
export POSTGRES_PORT=5432
|
|
||||||
export POSTGRES_HOST=postgres
|
|
||||||
export POSTGRES_DB=appflowy
|
|
||||||
|
|
||||||
export DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
|
|
||||||
|
|
@ -16,6 +16,4 @@ until PGPASSWORD="${DB_PASSWORD}" psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_
|
||||||
>&2 echo "Postgres is still unavailable - sleeping"
|
>&2 echo "Postgres is still unavailable - sleeping"
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
sqlx database create
|
|
||||||
sqlx migrate run
|
|
||||||
cargo run
|
cargo run
|
||||||
|
|
|
||||||
2
dev.env
2
dev.env
|
|
@ -23,4 +23,4 @@ GOTRUE_REGISTERED_EMAIL=your_email@some_company.com
|
||||||
GOTRUE_REGISTERED_PASSWORD=your_password
|
GOTRUE_REGISTERED_PASSWORD=your_password
|
||||||
|
|
||||||
# url to the postgres database
|
# url to the postgres database
|
||||||
DATABASE_URL=postgres://postgres:password@localhost:5433/appflowy
|
DATABASE_URL=postgres://postgres:password@localhost:5433/postgres
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue