fix(CI): sqlx offline mode
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
e9d5761ca6
commit
175fa084d1
18
.drone.yml
18
.drone.yml
|
@ -26,15 +26,13 @@ steps:
|
|||
- name: build
|
||||
image: docker:dind
|
||||
environment:
|
||||
DATABASE_URL: postgres://postgres:password@localhost:5432/newsletter
|
||||
SKIP_DOCKER: "true"
|
||||
DOCKER_USER:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
commands:
|
||||
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USER --password-stdin registry.coincoingit.fr
|
||||
- DOCKER_BUILDKIT=1 docker build --tag zero2prod:latest --network=host --file docker/build/Dockerfile .
|
||||
- DOCKER_BUILDKIT=1 docker build --tag zero2prod:latest --file docker/build/Dockerfile .
|
||||
- docker push registry.coincoingit.fr/zero2prod:latest
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
|
@ -61,6 +59,20 @@ steps:
|
|||
branch:
|
||||
- main
|
||||
|
||||
- name: migration
|
||||
image: registry.coincoingit.fr/zero2prod-tests:latest
|
||||
environment:
|
||||
POSTGRES_HOST: zero2prod_postgres
|
||||
POSTGRES_USER:
|
||||
from_secret: postgres_user
|
||||
POSTGRES_PASSWORD:
|
||||
from_secret: postgres_password
|
||||
POSTGRES_DB:
|
||||
from_secret: postgres_db
|
||||
SKIP_DOCKER: "true"
|
||||
commands:
|
||||
- ./scripts/init_db.sh
|
||||
|
||||
image_pull_secrets:
|
||||
- dockerconfig
|
||||
|
||||
|
|
|
@ -4,4 +4,11 @@ repos:
|
|||
hooks:
|
||||
- id: fmt
|
||||
- id: cargo-check
|
||||
- id: clippy
|
||||
- id: clippy
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: sqlx-offline
|
||||
name: sqlx-offline json
|
||||
entry: cargo sqlx prepare -- --lib
|
||||
language: system
|
||||
pass_filenames: false
|
|
@ -41,7 +41,8 @@ features = [
|
|||
"postgres",
|
||||
"uuid",
|
||||
"chrono",
|
||||
"migrate"
|
||||
"migrate",
|
||||
"offline"
|
||||
]
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -3,7 +3,7 @@ FROM --platform=linux/amd64 rust:1.65 AS builder
|
|||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV SQLX_OFFLINE true
|
||||
RUN cargo build --release
|
||||
|
||||
FROM --platform=linux/amd64 debian:bullseye-slim AS runtime
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"db": "PostgreSQL",
|
||||
"304de8963dc48aea581a2f654649b374940ff7de644af89aa33d8a93b90cae5f": {
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"nullable": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid",
|
||||
"Text",
|
||||
"Text",
|
||||
"Timestamptz"
|
||||
]
|
||||
}
|
||||
},
|
||||
"query": "\n\t\tINSERT INTO subscriptions (id, email, name, subscribed_at) VALUES ($1, $2, $3, $4)\n\t\t"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue