Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit 22cbfb0

Browse files
committed
Merge branch 'release/0.17.0'
2 parents 7848a13 + fdb4952 commit 22cbfb0

21 files changed

+425
-210
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Mine
22

33
clippy_results.txt
4+
bin/
45

56
# Generated by Cargo
67
# will have compiled files and executables

CHANGES_FROM_WS4SQLITE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
- License change from BSD to Apache 2
22
- Removed encryption feature (it was standard-based but very custom)
3-
- URL to contact for POST is now `http://<host>:<port>/<db_name&gt/exec` (note the `/exec/`)
43
- Read-only mode is performed via the `query_only` PRAGMA
54
- Even if the database is read only, it's possible to perform init macros
65
- YAML file, when explicitly given, is separated with a "::" from the db file/name (to solve ambiguities in windows)

Cargo.lock

Lines changed: 31 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
authors = ["Germano Rizzo <oss /AT/ germanorizzo /DOT/ it>"]
33
description = "A SQLite remote gateway - query SQLite via HTTP"
44
name = "sqliterg"
5-
version = "0.0.2"
5+
version = "0.17.0"
66
edition = "2021"
77
license = "Apache-2.0"
88

@@ -17,8 +17,8 @@ eyre = "~0"
1717
hex = "~0"
1818
ring = "~0"
1919
# rusqlite = { git = "https://github.com/rusqlite/rusqlite", features = ["serde_json"] }
20-
# rusqlite = { version = "~0", features = ["bundled", "serde_json"] }
21-
rusqlite = { version = "~0", features = ["serde_json"] }
20+
rusqlite = { version = "~0", features = ["bundled", "serde_json"] }
21+
# rusqlite = { version = "~0", features = ["serde_json"] }
2222
serde = { version = "~1", features = ["derive"] }
2323
serde_derive = "~1"
2424
serde_json = "~1"

Dockerfile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
# FROM rust:latest as build
2-
#
3-
# WORKDIR /app
4-
# COPY . .
5-
#
6-
# RUN cargo build
7-
# RUN pwd
8-
# RUN ls -al target/debug
9-
# --release
10-
111
FROM alpine:latest as build
122

13-
RUN apk add --no-cache rust cargo sqlite-libs sqlite-dev
3+
RUN apk add --no-cache rust cargo sqlite-libs sqlite-dev sed
144

155
COPY . /build
166
WORKDIR /build
7+
8+
RUN cp Cargo.toml Cargo.toml.orig
9+
RUN sed 's/^rusqlite.*$/rusqlite = { version = "~0", features = ["serde_json"] }/' Cargo.toml.orig > Cargo.toml
10+
1711
RUN ["cargo", "build", "--release"]
1812

1913
# Now copy it into our base image.
@@ -27,4 +21,4 @@ RUN apk add --no-cache sqlite-libs libgcc
2721
EXPOSE 12321
2822
VOLUME /data
2923

30-
CMD ["/sqliterg"]
24+
CMD ["/sqliterg"]

Dockerfile.binaries

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Used by make docker-zbuild-linux. See BUILDING.md
2+
3+
FROM rust:latest as build
4+
5+
RUN apt-get update
6+
RUN apt-get full-upgrade -y
7+
RUN apt-get install -y zip
8+
# RUN cargo install -f cross
9+
10+
WORKDIR /abc
11+
COPY . .
12+
13+
RUN make build-static-nostatic
14+
15+
# Now copy it into our base image.
16+
FROM scratch AS export
17+
COPY --from=build /abc/bin/* .

Makefile

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
.PHONY: test
22

3+
clean:
4+
cargo clean
5+
rm -rf bin
6+
- docker image prune -af
7+
- docker builder prune -af
8+
9+
update:
10+
cargo update
11+
cd tests && go get -u
12+
cd tests && go mod tidy
13+
14+
lint:
15+
cargo clippy 2> clippy_results.txt
16+
317
profile:
418
bash profiler/stress_sqliterg.sh
519
bash profiler/stress_ws4sqlite.sh
@@ -20,14 +34,53 @@ build-debug:
2034
build:
2135
cargo build --release
2236

23-
update:
24-
cargo update
25-
cd tests && go get -u
26-
cd tests && go mod tidy
37+
build-static-nostatic:
38+
rm -rf bin
39+
- mkdir bin
40+
bash -c "RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target `uname -m`-unknown-linux-gnu"
41+
bash -c "tar czf bin/sqliterg-v0.17.0-linux-`uname -m`-static-bundled.tar.gz -C target/`uname -m`-unknown-linux-gnu/release/ sqliterg"
42+
cp Cargo.toml Cargo.toml.orig
43+
sed 's/^rusqlite.*$$/rusqlite = { version = "~0", features = [\"serde_json\"] }/' Cargo.toml.orig > Cargo.toml
44+
bash -c "cargo build --release --target `uname -m`-unknown-linux-gnu"
45+
bash -c "tar czf bin/sqliterg-v0.17.0-linux-`uname -m`-dynamic.tar.gz -C target/`uname -m`-unknown-linux-gnu/release/ sqliterg"
46+
mv Cargo.toml.orig Cargo.toml
2747

28-
lint:
29-
cargo clippy 2> clippy_results.txt
48+
build-macos:
49+
rm -rf bin
50+
- mkdir bin
51+
cargo build --release
52+
tar czf bin/sqliterg-v0.17.0-macos-x86_64-bundled.tar.gz -C target/release/ sqliterg
53+
cargo build --release --target aarch64-apple-darwin
54+
tar czf bin/sqliterg-v0.17.0-macos-aarch64-bundled.tar.gz -C target/aarch64-apple-darwin/release/ sqliterg
55+
cp Cargo.toml Cargo.toml.orig
56+
sed 's/^rusqlite.*$$/rusqlite = { version = "~0", features = [\"serde_json\"] }/' Cargo.toml.orig > Cargo.toml
57+
cargo build --release
58+
tar czf bin/sqliterg-v0.17.0-macos-x86_64-dynamic.tar.gz -C target/release/ sqliterg
59+
cargo build --release --target aarch64-apple-darwin
60+
tar czf bin/sqliterg-v0.17.0-macos-aarch64-dynamic.tar.gz -C target/aarch64-apple-darwin/release/ sqliterg
61+
mv Cargo.toml.orig Cargo.toml
3062

3163
docker:
32-
docker buildx build . --no-cache -t germanorizzo/sqliterg:latest --push
33-
64+
docker run --privileged --rm tonistiigi/binfmt --install arm64
65+
docker buildx build --no-cache --platform linux/amd64 -t germanorizzo/sqliterg:v0.17.0-x86_64 --push .
66+
docker buildx build --no-cache --platform linux/arm64 -t germanorizzo/sqliterg:v0.17.0-aarch64 --push .
67+
- docker manifest rm germanorizzo/sqliterg:v0.17.0
68+
docker manifest create germanorizzo/sqliterg:v0.17.0 germanorizzo/sqliterg:v0.17.0-x86_64 germanorizzo/sqliterg:v0.17.0-aarch64
69+
docker manifest push germanorizzo/sqliterg:v0.17.0
70+
- docker manifest rm germanorizzo/sqliterg:latest
71+
docker manifest create germanorizzo/sqliterg:latest germanorizzo/sqliterg:v0.17.0-x86_64 germanorizzo/sqliterg:v0.17.0-aarch64
72+
docker manifest push germanorizzo/sqliterg:latest
73+
74+
docker-edge:
75+
# in Cargo.toml, set 'version = "0.x.999"' where x is the current minor
76+
docker run --privileged --rm tonistiigi/binfmt --install arm64,arm
77+
docker buildx build --no-cache --platform linux/amd64 -t germanorizzo/sqliterg:edge --push .
78+
79+
docker-zbuild-linux:
80+
- mkdir bin
81+
docker run --privileged --rm tonistiigi/binfmt --install arm64,arm
82+
docker buildx build --no-cache --platform linux/amd64 -f Dockerfile.binaries --target export -t tmp_binaries_build . --output bin
83+
docker buildx build --no-cache --platform linux/arm64 -f Dockerfile.binaries --target export -t tmp_binaries_build . --output bin
84+
# Doesn't work. armv7-unknown-linux-gnueabihf must be used. Anyway, for now ARMv7 is out of scope.
85+
# docker buildx build --no-cache --platform linux/arm/v7 -f Dockerfile.binaries --target export -t tmp_binaries_build . --output bin
86+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ As a quick example, after launching
1212
sqliterg --db mydatabase.db
1313
```
1414

15-
It's possible to make a POST call to `http://localhost:12321/mydatabase/exec`, e.g. with the following body:
15+
It's possible to make a POST call to `http://localhost:12321/mydatabase`, e.g. with the following body:
1616

1717
```json
1818
{

RELEASE_CHECKLIST.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- `make update`
2+
- `make clean`
3+
- `make test` [~5min]
4+
- Git: commit & push
5+
- Git(flow): Release start & push the branch
6+
- Update the version number
7+
- Git: commit ("Version labeling") & push
8+
- `make docker` [33min]
9+
- `make docker-zbuild-linux` [1h]
10+
- Compile on macos
11+
- checkout the release branch
12+
- `make build-macos` [17min]
13+
- Compile on windows
14+
- checkout the release branch
15+
- `cargo build --release` [7min]
16+
- Zip to a filename like `sqliterg-v0.x.y-win-x86_64-bundled.zip `
17+
- Git(flow): Release finish
18+
- Assemble the release on Github

0 commit comments

Comments
 (0)