All checks were successful
Publish azimuth-watcher docker image on release / Run docker build and publish (release) Successful in 2m5s
Reviewed-on: #3 Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
26 lines
807 B
Docker
26 lines
807 B
Docker
FROM node:18.16.0-alpine3.16
|
|
|
|
RUN apk --update --no-cache add git python3 alpine-sdk jq
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
# Get the latest Git commit hash and set it in package.json of all watchers
|
|
RUN COMMIT_HASH=$(git rev-parse HEAD) && \
|
|
find . -name 'package.json' -exec sh -c ' \
|
|
for packageFile; do \
|
|
jq --arg commitHash "$0" ".commitHash = \$commitHash" "$packageFile" > "$packageFile.tmp" && \
|
|
mv "$packageFile.tmp" "$packageFile"; \
|
|
done \
|
|
' "$COMMIT_HASH" {} \;
|
|
|
|
RUN echo "installing dependencies" && \
|
|
yarn
|
|
|
|
RUN echo "Building azimuth-watcher and gateway-server" && \
|
|
yarn build --scope @cerc-io/azimuth-watcher --scope @cerc-io/gateway-server
|
|
|
|
RUN echo "Install toml-js to update watcher config files" && \
|
|
yarn add --dev --ignore-workspace-root-check toml-js
|