Skip to content

Commit 59648bb

Browse files
committed
#576 earthly
1 parent c125a67 commit 59648bb

File tree

6 files changed

+35
-17
lines changed

6 files changed

+35
-17
lines changed

.earthlyignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target
2+
Dockerfile
3+
dockerfile
4+
browser/node_modules
5+
.dockerignore
6+
.env
7+
.git
8+
**/.temp
9+
.gitignore

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"server",
45
"cli",

Earthfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
VERSION 0.7
2-
PROJECT applied-knowledge-systems/atomic-server
2+
PROJECT ontola/atomic-server
33
# You can compile front end separately and copy dist folder
4-
# IMPORT ./browser AS browser
4+
IMPORT ./browser AS browser
55
FROM rust:latest
66
WORKDIR /code
77

88
main-pipeline:
9-
PIPELINE --push
10-
TRIGGER push main
11-
TRIGGER pr main
9+
PIPELINE --push
10+
TRIGGER push develop
11+
TRIGGER push main
12+
TRIGGER pr develop
1213
ARG tag=latest
1314
BUILD +build --tag=$tag
1415

1516
deps:
16-
RUN curl -fsSL https://bun.sh/install | bash
17-
RUN /root/.bun/bin/bun install -y pnpm
17+
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
1818
# COPY . .
1919
COPY --dir server lib cli desktop Cargo.lock Cargo.toml .
2020
# RUN mkdir src
2121
# RUN touch src/main.rs # adding main.rs stub so cargo fetch works to prepare the cache
22-
RUN cargo fetch
22+
RUN cargo fetch
2323

2424
test:
2525
FROM +deps
@@ -28,11 +28,10 @@ test:
2828
build:
2929
FROM +deps
3030
RUN rustup target add x86_64-unknown-linux-musl
31-
RUN apt update && apt install -y musl-tools musl-dev
31+
RUN apt update && apt install -y musl-tools musl-dev g++-x86-64-linux-gnu libc6-dev-amd64-cross
3232
RUN update-ca-certificates
3333
WORKDIR /app
34-
# FIXME: Joep you need to fix this line and modify Earthfile inside browser
35-
# COPY browser+build/dist ./public
34+
COPY browser+build/data-browser/dist /app/browser/data-browser/dist
3635
COPY --dir server lib cli desktop Cargo.lock Cargo.toml .
3736
RUN cargo build --release --bin atomic-server --config net.git-fetch-with-cli=true --target x86_64-unknown-linux-musl
3837
RUN strip -s /app/target/x86_64-unknown-linux-musl/release/atomic-server

browser/.earthlyignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

browser/Earthfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
VERSION 0.7
2-
PROJECT applied-knowledge-systems/atomic-server
2+
PROJECT atomicdata-dev/atomic-server
33
FROM node:latest
44
WORKDIR browser
55

66
main-pipeline:
7-
PIPELINE --push
8-
TRIGGER push main
9-
TRIGGER pr main
7+
PIPELINE --push
8+
TRIGGER push develop
9+
TRIGGER push main
10+
TRIGGER pr develop
1011
ARG tag=latest
1112
BUILD +build --tag=$tag
1213

1314
deps:
1415
RUN curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm
16+
COPY package.json pnpm-lock.yaml .
17+
# COPY data-browser/package.json data-browser/.
18+
# COPY lib/package.json lib/.
19+
# COPY react/package.json react/.
20+
RUN pnpm recursive install --frozen-lockfile --shamefully-hoist
1521
COPY . .
16-
RUN pnpm install --no-frozen-lockfile
22+
RUN pnpm install
1723
SAVE ARTIFACT node_modules /node_modules
1824

1925
build:
2026
FROM +deps
2127
RUN pnpm run build
22-
SAVE ARTIFACT dist /dist AS LOCAL dist
28+
SAVE ARTIFACT data-browser/dist data-browser/dist AS LOCAL dist

browser/tsconfig.build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"target": "ES5",
44
"module": "ES2022",
55
"lib": [
6+
// Not sure if DOM should be here. Lib should also work without a browser!
7+
"DOM",
68
"ES6",
79
"ES7",
810
"ESNext"

0 commit comments

Comments
 (0)