Skip to content

Commit e3dbfeb

Browse files
committed
fix param
1 parent efce4dd commit e3dbfeb

12 files changed

Lines changed: 74 additions & 152 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
/tmp/
55
/.shards/
66
*.dwarf
7+
.terraform
8+
.history

.gitlab/auto-deploy-postgres-values.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitlab/auto-deploy-values.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.tool-versions

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
crystal 0.35.1
1+
crystal 1.8.1
2+
node 21.1.0
3+
```

Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
FROM crystallang/crystal:0.35.1
2-
WORKDIR /app
1+
FROM 84codes/crystal:1.8.1-alpine as builder
32

4-
RUN apt-get update -y && apt-get install -y libsass-dev build-essential cmake python
3+
# Setup
4+
WORKDIR /build
5+
RUN apk add --no-cache openssl ca-certificates yaml-static curl cmake musl clang clang-dev alpine-sdk dpkg
6+
RUN openssl version -d
57

6-
COPY shard.yml shard.lock ./
7-
RUN shards install
8-
COPY . .
8+
# Deps
9+
COPY shard.lock shard.yml ./
10+
RUN shards install --production
911

10-
RUN shards build server --production --release
11-
RUN shards build job_runner --production
12+
# Build
13+
COPY . .
14+
RUN shards build --release --production --static
1215

13-
ENV PORT 5000
16+
# Import to scratch image
17+
FROM scratch
1418

15-
CMD ./bin/server
19+
ARG TARGET
20+
COPY --from=builder /build/bin/* /
21+
COPY --from=builder /build/bin/$TARGET /.main
22+
COPY --from=builder /etc/ssl/cert.pem /etc/ssl1.1/

docker-compose.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ networks:
33
default:
44
driver: bridge
55
volumes:
6-
postgres:
6+
cockroachdb:
77
services:
8-
postgres:
9-
image: postgres
10-
ports:
11-
- "5432:5432"
12-
volumes:
13-
- postgres:/var/lib/postgresql/data
14-
environment:
15-
POSTGRES_USER: postgres
16-
POSTGRES_PASSWORD: postgres
17-
POSTGRES_DB: crystalshards
8+
cockroachdb:
9+
image: cockroachdb/cockroach:v19.2.2
10+
ports:
11+
- "26257:26257"
12+
- "8080:8080"
13+
command: start-single-node --insecure
14+
volumes:
15+
- cockroachdb
1816
redis:
1917
image: redis
2018
ports:
@@ -28,7 +26,7 @@ services:
2826
environment:
2927
PORT: 3000
3028
REDIS_URL: redis://redis
31-
DATABASE_URL: postgres://postgres:postgres@postgres/crystalshards
29+
DATABASE_URL: postgres://postgres:postgres@postgres:26257/crystalshards
3230
GITHUB_TOKEN: ${GITHUB_TOKEN}
3331
ports:
3432
- "3000:3000"

helm-init.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

shard.lock

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,47 @@ version: 2.0
22
shards:
33
admiral:
44
git: https://github.com/jwaldrip/admiral.cr.git
5-
version: 1.11.2+git.commit.c3c3467953654554b72c24e7b853d6fbb23f10c0
5+
version: 1.12.1+git.commit.211937b64b753b86ccbe86a72122be30e294e31a
6+
7+
backtracer:
8+
git: https://github.com/sija/backtracer.cr.git
9+
version: 1.2.2
610

711
cache:
812
git: https://github.com/mamantoha/cache.git
9-
version: 0.9.0
13+
version: 0.14.0
1014

1115
clear:
1216
git: https://github.com/anykeyh/clear.git
13-
version: 0.8+git.commit.61946ba04b043c1fe680d8856d25dca8435d47c5
17+
version: 0.9
1418

1519
common_marker:
1620
git: https://github.com/mamantoha/crystal-cmark-gfm.git
17-
version: 0.3.0
21+
version: 0.6.0
1822

1923
crystar:
2024
git: https://github.com/naqvis/crystar.git
21-
version: 0.1.8
25+
version: 0.3.0
2226

2327
db:
2428
git: https://github.com/crystal-lang/crystal-db.git
25-
version: 0.9.0
29+
version: 0.11.0
2630

2731
emoji:
2832
git: https://github.com/veelenga/emoji.cr.git
29-
version: 0.4.0+git.commit.4642bd8ef64839b4639ba0be521e8c85113cb8d5
33+
version: 0.5.0+git.commit.78b46a18a5672de185690568f6d36d753bd6bacf
3034

3135
exception_page:
3236
git: https://github.com/crystal-loot/exception_page.git
33-
version: 0.1.4
37+
version: 0.3.0
3438

3539
generate:
3640
git: https://github.com/anykeyh/generate.cr.git
37-
version: 0.1.0+git.commit.27a59d663ded8ce39a361e3a88b8dd747f59ce42
41+
version: 0.1.0+git.commit.f5dafc934a70e0ee2f246dddf3df44686f844da2
42+
43+
habitat:
44+
git: https://github.com/luckyframework/habitat.git
45+
version: 0.4.7
3846

3947
html_builder:
4048
git: https://github.com/crystal-lang/html_builder.git
@@ -44,71 +52,59 @@ shards:
4452
git: https://github.com/jwaldrip/http_cache_handler.git
4553
version: 0.1.0+git.commit.f0f2ad8138b826760a854e8b70c69059431a3167
4654

47-
icr:
48-
git: https://github.com/crystal-community/icr.git
49-
version: 0.8.0+git.commit.8c57cd7c1fdf8088cb05c1587bd6c40d244a8a80
50-
5155
inflector:
5256
git: https://github.com/phoffer/inflector.cr.git
5357
version: 0.1.8
5458

5559
json_mapping:
5660
git: https://github.com/crystal-lang/json_mapping.cr.git
57-
version: 0.1.0
61+
version: 0.1.1
5862

5963
kilt:
6064
git: https://github.com/jeromegn/kilt.git
61-
version: 0.6.0
62-
63-
memcached:
64-
git: https://github.com/comandeo/crystal-memcached.git
65-
version: 0.2.2+git.commit.ee02a364a0274df0cde3d1bb3ef958e2e7c07c18
65+
version: 0.6.1
6666

6767
mosquito:
68-
git: https://github.com/robacarp/mosquito.git
69-
version: 0.7.0
68+
git: https://github.com/mosquito-cr/mosquito.git
69+
version: 0.11.2
7070

7171
oak:
7272
git: https://github.com/obsidian/oak.git
73-
version: 4.0.0
73+
version: 4.0.1
7474

7575
orion:
7676
git: https://github.com/obsidian/orion.git
7777
version: 4.0.0-beta1
7878

7979
pg:
8080
git: https://github.com/will/crystal-pg.git
81-
version: 0.21.1+git.commit.cafe111fc28e366c219144d5f656c3718d7357dd
81+
version: 0.26.0+git.commit.cafe599847b127431b13968a725702ff3c0320ac
8282

8383
pool:
8484
git: https://github.com/ysbaddaden/pool.git
85-
version: 0.2.3
86-
87-
readline:
88-
git: https://github.com/crystal-lang/crystal-readline.git
89-
version: 0.1.0+git.commit.0fb7d186da8e1b157998d98d1c96e99699b791eb
85+
version: 0.3.0
9086

9187
redis:
9288
git: https://github.com/stefanwille/crystal-redis.git
93-
version: 2.6.0
89+
version: 2.8.3
9490

9591
sass:
9692
git: https://github.com/straight-shoota/sass.cr.git
97-
version: 0.5.0
93+
version: 0.6.0
9894

9995
sentry:
100-
git: https://github.com/watzon/sentry.git
101-
version: 0.3.2+git.commit.c112bb53a1de3b3d90d712b9435b63901188bcc0
96+
git: https://github.com/samueleaton/sentry.git
97+
version: 0.5.0
10298

10399
slang:
104100
git: https://github.com/jeromegn/slang.git
105-
version: 1.7.1
101+
version: 1.7.3
106102

107103
wordsmith:
108104
git: https://github.com/luckyframework/wordsmith.git
109-
version: 0.2.1
105+
version: 0.4.0
110106

111107
yaml_mapping:
112108
git: https://github.com/crystal-lang/yaml_mapping.cr.git
113-
version: 0.1.0
109+
version: 0.1.1
114110

shard.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Crystal Shards
22
description: The public index of CrystalShards around the web.
33
version: 1.0.0
4-
crystal: 0.35.0
4+
crystal: 1.8.1
55

66
authors:
77
- Jason Waldrip <jason@waldrip.net>
88

99
targets:
10-
server:
11-
main: src/server.cr
10+
web:
11+
main: src/web.cr
1212
job_runner:
1313
main: src/job_runner.cr
1414

@@ -19,16 +19,14 @@ dependencies:
1919
clear:
2020
github: anykeyh/clear
2121
mosquito:
22-
github: robacarp/mosquito
23-
version: 0.7.0
24-
http_cache_handler:
25-
github: jwaldrip/http_cache_handler
22+
github: mosquito-cr/mosquito
23+
version: 0.11.2
2624
kilt:
2725
github: jeromegn/kilt
28-
version: 0.6.0
26+
version: 0.6.1
2927
slang:
3028
github: jeromegn/slang
31-
version: 1.7.1
29+
version: 1.7.3
3230
sass:
3331
github: straight-shoota/sass.cr
3432
emoji:
@@ -41,18 +39,14 @@ dependencies:
4139
version: ~> 0.2
4240
redis:
4341
github: stefanwille/crystal-redis
44-
version: ~> 2.6.0
42+
version: ~> 2.8.0
4543
json_mapping:
4644
github: crystal-lang/json_mapping.cr
4745
yaml_mapping:
4846
github: crystal-lang/yaml_mapping.cr
4947

5048
development_dependencies:
5149
sentry:
52-
github: watzon/sentry
53-
branch: master
54-
icr:
55-
github: crystal-community/icr
56-
branch: master
50+
github: samueleaton/sentry
5751

5852
license: MIT

src/models/author.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Author
1010

1111
timestamps
1212

13+
has_many shard_authors : ShardAuthor
1314
has_many shards : Shard, through: "shard_authors"
1415

1516
scope :includes_uses do

0 commit comments

Comments
 (0)