-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathEarthfile
123 lines (105 loc) · 3.68 KB
/
Earthfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
VERSION 0.8
IMPORT --allow-privileged github.com/cardano-foundation/cf-gha-workflows/./earthfiles/functions:main AS functions
ARG --global DOCKER_IMAGES_TARGETS="idw-keria idw-witness cred-issuance cred-issuance-ui"
ARG --global DOCKER_IMAGES_PREFIX="cf"
ARG --global DOCKER_IMAGES_EXTRA_TAGS=""
ARG --global DOCKER_REGISTRIES=""
ARG --global RELEASE_TAG=""
ARG --global PUSH=false
ARG --global KERIA_GIT_REPO_URL="https://github.com/WebOfTrust/keria.git"
ARG --global KERIA_GIT_REF=736947191069cfc1617a43f63dbc64210c351b5c
ARG --global KERI_DOCKER_IMAGE_REPO=weboftrust/keri
ARG --global KERI_DOCKER_IMAGE_TAG=1.1.6
all:
LOCALLY
FOR image_target IN $DOCKER_IMAGES_TARGETS
BUILD +$image_target --PUSH=$PUSH
END
docker-publish:
BUILD +all --PUSH=$PUSH
keria-src:
FROM alpine/git
RUN git clone $KERIA_GIT_REPO_URL /keria && \
cd /keria && \
git checkout $KERIA_GIT_REF
SAVE ARTIFACT /keria
idw-keria:
ARG EARTHLY_TARGET_NAME
ARG DOCKER_IMAGES_EXTRA_TAGS
ARG FORCE_BUILD=false
LET DOCKER_IMAGE_NAME=${DOCKER_IMAGES_PREFIX}-${EARTHLY_TARGET_NAME}
LOCALLY
IF [ "${FORCE_BUILD}" = "false" ]
ARG REGISTRY_IMAGE_EXISTS=$( ( docker manifest inspect ${HUB_DOCKER_COM_USER}/${DOCKER_IMAGE_NAME}:keria-${KERIA_GIT_REF} 2>/dev/null | grep -q layers ) || echo false)
ELSE
ARG REGISTRY_IMAGE_EXISTS=false
END
IF [ "${REGISTRY_IMAGE_EXISTS}" = "false" ]
WAIT
FROM DOCKERFILE -f +keria-src/keria/images/keria.dockerfile +keria-src/keria/*
RUN apk add --no-cache jq envsubst
ENTRYPOINT keria start --config-file backer-oobis --config-dir ./scripts
END
WAIT
SAVE IMAGE ${DOCKER_IMAGE_NAME}:$KERIA_GIT_REF
SAVE IMAGE ${DOCKER_IMAGE_NAME}:latest
END
DO functions+DOCKER_TAG_N_PUSH \
--PUSH=$PUSH \
--DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} \
--DOCKER_IMAGES_EXTRA_TAGS="${DOCKER_IMAGES_EXTRA_TAGS} keria-${KERIA_GIT_REF}"
END
idw-witness:
ARG EARTHLY_TARGET_NAME
ARG DOCKER_IMAGES_EXTRA_TAGS
ARG FORCE_BUILD=false
LET DOCKER_IMAGE_NAME=${DOCKER_IMAGES_PREFIX}-${EARTHLY_TARGET_NAME}
LOCALLY
IF [ "${FORCE_BUILD}" = "false" ]
ARG REGISTRY_IMAGE_EXISTS=$( (docker manifest inspect ${HUB_DOCKER_COM_USER}/${DOCKER_IMAGE_NAME}:keri-${KERI_DOCKER_IMAGE_TAG} 2> /dev/null | grep -q layers) || echo false)
ELSE
ARG REGISTRY_IMAGE_EXISTS=false
END
IF [ "${REGISTRY_IMAGE_EXISTS}" = "false" ]
WAIT
FROM ${KERI_DOCKER_IMAGE_REPO}:${KERI_DOCKER_IMAGE_TAG}
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
RUN apk add --no-cache jq envsubst
ENTRYPOINT kli witness demo
END
WAIT
SAVE IMAGE ${DOCKER_IMAGE_NAME}:keri-${KERI_DOCKER_IMAGE_TAG}
SAVE IMAGE ${DOCKER_IMAGE_NAME}:latest
END
DO functions+DOCKER_TAG_N_PUSH \
--PUSH=$PUSH \
--DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} \
--DOCKER_IMAGES_EXTRA_TAGS="${DOCKER_IMAGES_EXTRA_TAGS} keri-${KERI_DOCKER_IMAGE_TAG}"
END
cred-issuance:
ARG EARTHLY_TARGET_NAME
LET DOCKER_IMAGE_NAME=${DOCKER_IMAGES_PREFIX}-${EARTHLY_TARGET_NAME}
WAIT
FROM DOCKERFILE ./services/credential-server
END
WAIT
SAVE IMAGE ${DOCKER_IMAGE_NAME}
END
DO functions+DOCKER_TAG_N_PUSH \
--PUSH=$PUSH \
--DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} \
--DOCKER_IMAGES_EXTRA_TAGS="${DOCKER_IMAGES_EXTRA_TAGS}"
cred-issuance-ui:
ARG EARTHLY_TARGET_NAME
LET DOCKER_IMAGE_NAME=${DOCKER_IMAGES_PREFIX}-${EARTHLY_TARGET_NAME}
WAIT
FROM DOCKERFILE ./services/credential-server-ui
END
WAIT
SAVE IMAGE ${DOCKER_IMAGE_NAME}
END
DO functions+DOCKER_TAG_N_PUSH \
--PUSH=$PUSH \
--DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} \
--DOCKER_IMAGES_EXTRA_TAGS="${DOCKER_IMAGES_EXTRA_TAGS}"