Skip to content

Commit

Permalink
Other minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaionescu committed Feb 8, 2024
1 parent 59488d5 commit c827f00
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
18 changes: 9 additions & 9 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
VERSION 0.8

all-test:
BUILD ./rust_server/+test
BUILD ./go_server/+test
BUILD ./python_server/+test
BUILD ./node_server/+test
BUILD ./quote_client/+test
BUILD ./rust_server+test
BUILD ./go_server+test
BUILD ./python_server+test
BUILD ./node_server+test
BUILD ./quote_client+test

build-services:
ARG tag=latest
BUILD ./rust_server/+docker --tag=$tag
BUILD ./go_server/+docker --tag=$tag
BUILD ./node_server/+docker --tag=$tag
BUILD ./python_server/+docker --tag=$tag
BUILD ./rust_server+docker --tag=$tag
BUILD ./go_server+docker --tag=$tag
BUILD ./node_server+docker --tag=$tag
BUILD ./python_server+docker --tag=$tag

dev-up:
LOCALLY
Expand Down
6 changes: 3 additions & 3 deletions infra/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ deploy:
ARG --required tag
ARG --required port
LET name=$(basename $image)
RUN --no-cache --secret FLY_API_TOKEN=fly_api_token if /root/.fly/bin/flyctl apps destroy -y $name | grep "Could not find"; then echo "App not found"; else echo "App found, recreating"; fi
RUN --no-cache --secret FLY_API_TOKEN=fly_api_token /root/.fly/bin/flyctl launch --image $image:$tag --internal-port $port --name $name --org earthly --region lax
RUN --no-cache --secret FLY_API_TOKEN=fly_api_token /root/.fly/bin/flyctl deploy
RUN --push --secret FLY_API_TOKEN=fly_api_token if /root/.fly/bin/flyctl apps destroy -y $name | grep "Could not find"; then echo "App not found"; else echo "App found, recreating"; fi
RUN --push --secret FLY_API_TOKEN=fly_api_token /root/.fly/bin/flyctl launch --image $image:$tag --internal-port $port --name $name --org earthly --region lax
RUN --push --secret FLY_API_TOKEN=fly_api_token /root/.fly/bin/flyctl deploy
1 change: 0 additions & 1 deletion node_server/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ deps:
build:
FROM +deps
COPY src src
# Overwrite quotes
COPY ../quote_generator+artifact/quotes.txt quotes.txt

test:
Expand Down
4 changes: 1 addition & 3 deletions python_server/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ deps:
build:
FROM +deps
COPY src src
#COPY quotes.txt ./
COPY ../quote_generator+artifact/quotes.txt quotes.txt
SAVE ARTIFACT src /src
SAVE ARTIFACT wheels /wheels
Expand All @@ -34,7 +33,6 @@ docker:
ARG tag=latest
COPY +build/src src
COPY +build/wheels wheels
# quotes.txt needs to go into src for gunicorn to pick it up
COPY +build/quotes.txt src/quotes.txt
COPY start.sh ./
COPY requirements.txt ./
Expand All @@ -47,4 +45,4 @@ deploy:
ARG tag=latest
BUILD ../infra+deploy --image=idelvall/earthly-demo-python --tag=$tag --port=80
RUN echo "https://earthly-demo-python.fly.dev">service
SAVE ARTIFACT service service
SAVE ARTIFACT service
5 changes: 2 additions & 3 deletions rust_server/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ test:
build:
FROM +source
DO rust+CARGO --args="build --release --bin quote_server" --output="release/[^/\.]+"
SAVE ARTIFACT target/release/quote_server quote_server AS LOCAL artifact/target
SAVE ARTIFACT target/release/quote_server AS LOCAL target/

docker:
ARG tag=latest
COPY +build/quote_server quote_server
# We also have to copy Rocket.toml so that Rocket binds to the correct address and port within the container.
COPY Rocket.toml Rocket.toml
COPY ../quote_generator+artifact/quotes.txt quotes.txt
EXPOSE 80
Expand All @@ -36,4 +35,4 @@ deploy:
ARG tag=latest
BUILD ../infra+deploy --image=idelvall/earthly-demo-rust --tag=$tag --port=80
RUN echo "https://earthly-demo-rust.fly.dev">service
SAVE ARTIFACT service service
SAVE ARTIFACT service

0 comments on commit c827f00

Please sign in to comment.