Skip to content

Commit

Permalink
fix param
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaldrip committed May 7, 2023
1 parent efce4dd commit e3dbfeb
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 152 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,5 @@
/tmp/
/.shards/
*.dwarf
.terraform
.history
4 changes: 0 additions & 4 deletions .gitlab/auto-deploy-postgres-values.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .gitlab/auto-deploy-values.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .tool-versions
@@ -1 +1,3 @@
crystal 0.35.1
crystal 1.8.1
node 21.1.0
```
27 changes: 17 additions & 10 deletions Dockerfile
@@ -1,15 +1,22 @@
FROM crystallang/crystal:0.35.1
WORKDIR /app
FROM 84codes/crystal:1.8.1-alpine as builder

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

COPY shard.yml shard.lock ./
RUN shards install
COPY . .
# Deps
COPY shard.lock shard.yml ./
RUN shards install --production

RUN shards build server --production --release
RUN shards build job_runner --production
# Build
COPY . .
RUN shards build --release --production --static

ENV PORT 5000
# Import to scratch image
FROM scratch

CMD ./bin/server
ARG TARGET
COPY --from=builder /build/bin/* /
COPY --from=builder /build/bin/$TARGET /.main
COPY --from=builder /etc/ssl/cert.pem /etc/ssl1.1/
22 changes: 10 additions & 12 deletions docker-compose.yml
Expand Up @@ -3,18 +3,16 @@ networks:
default:
driver: bridge
volumes:
postgres:
cockroachdb:
services:
postgres:
image: postgres
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: crystalshards
cockroachdb:
image: cockroachdb/cockroach:v19.2.2
ports:
- "26257:26257"
- "8080:8080"
command: start-single-node --insecure
volumes:
- cockroachdb
redis:
image: redis
ports:
Expand All @@ -28,7 +26,7 @@ services:
environment:
PORT: 3000
REDIS_URL: redis://redis
DATABASE_URL: postgres://postgres:postgres@postgres/crystalshards
DATABASE_URL: postgres://postgres:postgres@postgres:26257/crystalshards
GITHUB_TOKEN: ${GITHUB_TOKEN}
ports:
- "3000:3000"
Expand Down
18 changes: 0 additions & 18 deletions helm-init.sh

This file was deleted.

66 changes: 31 additions & 35 deletions shard.lock
Expand Up @@ -2,39 +2,47 @@ version: 2.0
shards:
admiral:
git: https://github.com/jwaldrip/admiral.cr.git
version: 1.11.2+git.commit.c3c3467953654554b72c24e7b853d6fbb23f10c0
version: 1.12.1+git.commit.211937b64b753b86ccbe86a72122be30e294e31a

backtracer:
git: https://github.com/sija/backtracer.cr.git
version: 1.2.2

cache:
git: https://github.com/mamantoha/cache.git
version: 0.9.0
version: 0.14.0

clear:
git: https://github.com/anykeyh/clear.git
version: 0.8+git.commit.61946ba04b043c1fe680d8856d25dca8435d47c5
version: 0.9

common_marker:
git: https://github.com/mamantoha/crystal-cmark-gfm.git
version: 0.3.0
version: 0.6.0

crystar:
git: https://github.com/naqvis/crystar.git
version: 0.1.8
version: 0.3.0

db:
git: https://github.com/crystal-lang/crystal-db.git
version: 0.9.0
version: 0.11.0

emoji:
git: https://github.com/veelenga/emoji.cr.git
version: 0.4.0+git.commit.4642bd8ef64839b4639ba0be521e8c85113cb8d5
version: 0.5.0+git.commit.78b46a18a5672de185690568f6d36d753bd6bacf

exception_page:
git: https://github.com/crystal-loot/exception_page.git
version: 0.1.4
version: 0.3.0

generate:
git: https://github.com/anykeyh/generate.cr.git
version: 0.1.0+git.commit.27a59d663ded8ce39a361e3a88b8dd747f59ce42
version: 0.1.0+git.commit.f5dafc934a70e0ee2f246dddf3df44686f844da2

habitat:
git: https://github.com/luckyframework/habitat.git
version: 0.4.7

html_builder:
git: https://github.com/crystal-lang/html_builder.git
Expand All @@ -44,71 +52,59 @@ shards:
git: https://github.com/jwaldrip/http_cache_handler.git
version: 0.1.0+git.commit.f0f2ad8138b826760a854e8b70c69059431a3167

icr:
git: https://github.com/crystal-community/icr.git
version: 0.8.0+git.commit.8c57cd7c1fdf8088cb05c1587bd6c40d244a8a80

inflector:
git: https://github.com/phoffer/inflector.cr.git
version: 0.1.8

json_mapping:
git: https://github.com/crystal-lang/json_mapping.cr.git
version: 0.1.0
version: 0.1.1

kilt:
git: https://github.com/jeromegn/kilt.git
version: 0.6.0

memcached:
git: https://github.com/comandeo/crystal-memcached.git
version: 0.2.2+git.commit.ee02a364a0274df0cde3d1bb3ef958e2e7c07c18
version: 0.6.1

mosquito:
git: https://github.com/robacarp/mosquito.git
version: 0.7.0
git: https://github.com/mosquito-cr/mosquito.git
version: 0.11.2

oak:
git: https://github.com/obsidian/oak.git
version: 4.0.0
version: 4.0.1

orion:
git: https://github.com/obsidian/orion.git
version: 4.0.0-beta1

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

pool:
git: https://github.com/ysbaddaden/pool.git
version: 0.2.3

readline:
git: https://github.com/crystal-lang/crystal-readline.git
version: 0.1.0+git.commit.0fb7d186da8e1b157998d98d1c96e99699b791eb
version: 0.3.0

redis:
git: https://github.com/stefanwille/crystal-redis.git
version: 2.6.0
version: 2.8.3

sass:
git: https://github.com/straight-shoota/sass.cr.git
version: 0.5.0
version: 0.6.0

sentry:
git: https://github.com/watzon/sentry.git
version: 0.3.2+git.commit.c112bb53a1de3b3d90d712b9435b63901188bcc0
git: https://github.com/samueleaton/sentry.git
version: 0.5.0

slang:
git: https://github.com/jeromegn/slang.git
version: 1.7.1
version: 1.7.3

wordsmith:
git: https://github.com/luckyframework/wordsmith.git
version: 0.2.1
version: 0.4.0

yaml_mapping:
git: https://github.com/crystal-lang/yaml_mapping.cr.git
version: 0.1.0
version: 0.1.1

24 changes: 9 additions & 15 deletions shard.yml
@@ -1,14 +1,14 @@
name: Crystal Shards
description: The public index of CrystalShards around the web.
version: 1.0.0
crystal: 0.35.0
crystal: 1.8.1

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

targets:
server:
main: src/server.cr
web:
main: src/web.cr
job_runner:
main: src/job_runner.cr

Expand All @@ -19,16 +19,14 @@ dependencies:
clear:
github: anykeyh/clear
mosquito:
github: robacarp/mosquito
version: 0.7.0
http_cache_handler:
github: jwaldrip/http_cache_handler
github: mosquito-cr/mosquito
version: 0.11.2
kilt:
github: jeromegn/kilt
version: 0.6.0
version: 0.6.1
slang:
github: jeromegn/slang
version: 1.7.1
version: 1.7.3
sass:
github: straight-shoota/sass.cr
emoji:
Expand All @@ -41,18 +39,14 @@ dependencies:
version: ~> 0.2
redis:
github: stefanwille/crystal-redis
version: ~> 2.6.0
version: ~> 2.8.0
json_mapping:
github: crystal-lang/json_mapping.cr
yaml_mapping:
github: crystal-lang/yaml_mapping.cr

development_dependencies:
sentry:
github: watzon/sentry
branch: master
icr:
github: crystal-community/icr
branch: master
github: samueleaton/sentry

license: MIT
1 change: 1 addition & 0 deletions src/models/author.cr
Expand Up @@ -10,6 +10,7 @@ class Author

timestamps

has_many shard_authors : ShardAuthor
has_many shards : Shard, through: "shard_authors"

scope :includes_uses do
Expand Down
1 change: 1 addition & 0 deletions src/models/shard.cr
Expand Up @@ -29,6 +29,7 @@ class Shard
# Associations
belongs_to project : Project
has_many dependencies : ShardDependency, foreign_key: "parent_id"
has_many shard_authors : ShardAuthor
has_many authors : Author, through: "shard_authors"

# Copy spec data to shard
Expand Down
37 changes: 0 additions & 37 deletions src/server.cr

This file was deleted.

0 comments on commit e3dbfeb

Please sign in to comment.