Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/tools-rippled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ env:
DOXYGEN_VERSION: 1.9.8+ds-2build5
GCC_VERSION: 14
GRAPHVIZ_VERSION: 2.42.2-9ubuntu0.1
NODE_VERSION: 24.5.0
NPM_VERSION: 11.5.2
NVM_VERSION: 0.40.3
PRETTIER_VERSION: 3.6.2
PRE_COMMIT_VERSION: 4.2.0
UBUNTU_VERSION: noble

Expand All @@ -38,6 +42,7 @@ jobs:
tool:
- clang-format
- documentation
- prettier
runs-on: ${{ matrix.architecture.runner }}
permissions:
packages: write
Expand Down Expand Up @@ -91,6 +96,10 @@ jobs:
DOXYGEN_VERSION=${{ env.DOXYGEN_VERSION }}
GCC_VERSION=${{ env.GCC_VERSION }}
GRAPHVIZ_VERSION=${{ env.GRAPHVIZ_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
NPM_VERSION=${{ env.NPM_VERSION }}
NVM_VERSION=${{ env.NVM_VERSION }}
PRETTIER_VERSION=${{ env.PRETTIER_VERSION }}
PRE_COMMIT_VERSION=${{ env.PRE_COMMIT_VERSION }}
context: docker/tools-rippled
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
Expand Down Expand Up @@ -122,6 +131,7 @@ jobs:
tool:
- clang-format
- documentation
- prettier
runs-on: ubuntu-24.04
needs:
- build
Expand Down
33 changes: 29 additions & 4 deletions docker/tools-rippled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ ENV PATH=${VIRTUAL_ENV}/bin:${PATH}

FROM base AS clang-format

# These are not inherited from base image.
ARG UBUNTU_VERSION
# This is not inherited from base image.
ARG DEBIAN_FRONTEND=noninteractive

# Install clang-format.
Expand All @@ -69,8 +68,7 @@ WORKDIR ${HOME}

FROM base AS documentation

# These are not inherited from base image.
ARG UBUNTU_VERSION
# This is not inherited from base image.
ARG DEBIAN_FRONTEND=noninteractive

# Install cmake, required to build the `docs` target.
Expand Down Expand Up @@ -119,3 +117,30 @@ EOF

ENV HOME=/root
WORKDIR ${HOME}

# ====================== PRETTIER IMAGE ======================
# Note, we do not install a compiler here.

FROM base AS prettier

# This is not inherited from base image.
ARG DEBIAN_FRONTEND=noninteractive

# Install node and npm via nvm, and then install prettier, see also
# https://nodejs.org/en/download.
ARG NODE_VERSION
ARG NPM_VERSION
ARG NVM_VERSION
ARG PRETTIER_VERSION
ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org
RUN <<EOF
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash
\. "${HOME}/.nvm/nvm.sh"
nvm install ${NODE_VERSION}
npm install -g --no-audit --no-fund npm@${NPM_VERSION}
npm install -g --no-audit --no-fund prettier@${PRETTIER_VERSION}
npm cache clean --force
EOF

ENV HOME=/root
WORKDIR ${HOME}
26 changes: 26 additions & 0 deletions docker/tools-rippled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,32 @@ docker buildx build . \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
```

#### Building the Docker image for prettier

Ensure you've run the login command above to authenticate with the Docker
registry.

```shell
UBUNTU_VERSION=noble
NODE_VERSION=24.5.0
NPM_VERSION=11.5.2
NVM_VERSION=0.40.3
PRETTIER_VERSION=3.6.2
CONTAINER_IMAGE=xrplf/ci/tools-rippled-prettier:latest

docker buildx build . \
--file docker/tools-rippled/Dockerfile \
--target prettier \
--build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg NODE_VERSION=${NODE_VERSION} \
--build-arg NPM_VERSION=${NPM_VERSION} \
--build-arg NVM_VERSION=${NVM_VERSION} \
--build-arg PRETTIER_VERSION=${PRETTIER_VERSION} \
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \
--tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE}
```

#### Pushing the Docker image to the GitHub registry

If you want to push the image to the GitHub registry, you can do so with the
Expand Down