Skip to content

Commit

Permalink
Copy less directories on the Dockerfile (#64)
Browse files Browse the repository at this point in the history
Otherwise it might copy `build`, resulting in a conflict if the user has
a local build already.

Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Jun 7, 2024
1 parent 286b500 commit e32584d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ if(JSONSCHEMA_TESTS)
endif()

# As a sanity check
file(READ "${PROJECT_SOURCE_DIR}/action.yml" ACTION_YML)
string(FIND "${ACTION_YML}" "${PROJECT_VERSION}" ACTION_YML_HAS_VERSION)
if(${ACTION_YML_HAS_VERSION} EQUAL -1)
message(FATAL_ERROR
"The GitHub Action definition must set the correct version: ${PROJECT_VERSION}")
if(EXISTS "${PROJECT_SOURCE_DIR}/action.yml")
file(READ "${PROJECT_SOURCE_DIR}/action.yml" ACTION_YML)
string(FIND "${ACTION_YML}" "${PROJECT_VERSION}" ACTION_YML_HAS_VERSION)
if(${ACTION_YML_HAS_VERSION} EQUAL -1)
message(FATAL_ERROR
"The GitHub Action definition must set the correct version: ${PROJECT_VERSION}")
endif()
endif()

# Packaging
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tz
# Tools to compile:
RUN apt install -y build-essential cmake clang-format shellcheck curl

COPY . /compile
COPY cmake /compile/cmake
COPY src /compile/src
COPY test /compile/test
COPY vendor /compile/vendor
COPY CMakeLists.txt /compile/CMakeLists.txt
COPY Makefile /compile/Makefile
WORKDIR /compile

RUN make configure
Expand All @@ -18,4 +23,4 @@ RUN make compile
FROM ubuntu
COPY --from=compiler /compile/build/dist/bin/jsonschema /usr/local/bin/jsonschema
WORKDIR /schema
ENTRYPOINT ["/usr/local/bin/jsonschema"]
ENTRYPOINT ["/usr/local/bin/jsonschema"]

0 comments on commit e32584d

Please sign in to comment.