-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathEarthfile
More file actions
30 lines (28 loc) · 775 Bytes
/
Earthfile
File metadata and controls
30 lines (28 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
VERSION --arg-scope-and-set 0.7
# DEEP_CLONE deep clones the provided git url
DEEP_CLONE:
COMMAND
ARG USE_GIT_ENV="false"
IF [ $USE_GIT_ENV = "true" ]
FROM alpine/git:v2.40.1
END
DO ../ssh+ADD_KNOWN_HOSTS
ARG --required GIT_URL
ARG DEST_DIR
LET dest_dir=$DEST_DIR
IF [ -z $dest_dir ]
SET dest_dir=$(basename ${GIT_URL%.git})
END
GIT CLONE $GIT_URL $dest_dir
WORKDIR $dest_dir
RUN git remote set-url origin $GIT_URL
ARG git_hash=$(git rev-parse HEAD)
ARG SECRET_PATH
IF [ -z $SECRET_PATH ]
RUN --ssh git fetch --unshallow
ELSE
RUN --mount=type=secret,id=$SECRET_PATH,mode=0400,target=/root/.ssh/id_rsa \
git fetch --unshallow
END
test:
BUILD ./tests+all