Skip to content

Commit

Permalink
COMMAND is now FUNCTION with earthly 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
glehmann committed Feb 15, 2024
1 parent f3cf5b0 commit 663d46f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions deploy/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deps:
COPY +kubectl/kubectl /usr/bin/kubectl

SETUP:
COMMAND
FUNCTION
FROM +deps
WORKDIR /app
RUN --no-cache --secret dockerhub_token \
Expand All @@ -40,7 +40,7 @@ SETUP:
echo $github_token | helm registry login -u eniblock ghcr.io --password-stdin

TAG_DEPLOYED:
COMMAND
FUNCTION
ARG --required repositories
ARG --required tag
ARG --required environment
Expand All @@ -49,7 +49,7 @@ TAG_DEPLOYED:
END

TAG_DEPLOYED2:
COMMAND
FUNCTION
ARG --required images
ARG --required environment
FOR image IN ${images}
Expand Down
14 changes: 7 additions & 7 deletions helm/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ helmtools:
ENV YAMLLINT_CONFIG_FILE=/etc/yamllint.yaml

BASE:
COMMAND
FUNCTION
FROM +helmtools

LOGIN:
COMMAND
FUNCTION
ARG registry=ghcr.io
ARG username=eniblock
RUN --no-cache \
--secret registry_password \
helm registry login -u "${username}" -p "${registry_password}" "${registry}"

UPDATE:
COMMAND
FUNCTION
ARG helmdir=.
COPY "${helmdir}/Chart.yaml" ./Chart.yaml
ARG login=false
Expand All @@ -65,14 +65,14 @@ UPDATE:
END

LINT:
COMMAND
FUNCTION
ARG helmdir=.
COPY "${helmdir}" ./
ARG environment=dev
RUN lint . --values values-${environment}.yaml

BUILD:
COMMAND
FUNCTION
ARG helmdir=.
COPY "${helmdir}" ./
ARG patch_app_version=true
Expand All @@ -81,14 +81,14 @@ BUILD:
RUN /usr/local/bin/build "${tag}" "${patch_app_version}" "${patch_values}"

PUBLISH:
COMMAND
FUNCTION
ARG repository
ARG package="*-*.tgz"
RUN --push helm push $package "oci://$(dirname $repository)"

# this is deprecated, use PUBLISH
PUBLISH_HELM:
COMMAND
FUNCTION
ARG helmdir
ARG image
ARG patch_value
Expand Down
10 changes: 5 additions & 5 deletions terraform/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ deps:
COPY +terraform/terraform /usr/local/bin/

SETUP:
COMMAND
FUNCTION
FROM +deps
WORKDIR /tf
ARG tfdir=.
Expand All @@ -33,7 +33,7 @@ SETUP:
&& terraform workspace select "$environment"

RUN:
COMMAND
FUNCTION
ARG --required command
ARG options
ARG output=/dev/stdout
Expand All @@ -42,21 +42,21 @@ RUN:
terraform $command $options > $output

PLAN:
COMMAND
FUNCTION
ARG tfdir=.
ARG --required environment
DO +SETUP --tfdir $tfdir --environment "$environment"
DO +RUN --environment "$environment" --command plan

APPLY:
COMMAND
FUNCTION
ARG tfdir=.
ARG --required environment
DO +SETUP --tfdir $tfdir --environment "$environment"
DO +RUN --environment "$environment" --command apply --options "-input=false -auto-approve"

OUTPUT:
COMMAND
FUNCTION
ARG tfdir=.
ARG --required environment
DO +SETUP --tfdir $tfdir --environment "$environment"
Expand Down

0 comments on commit 663d46f

Please sign in to comment.