Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy less directories on the Dockerfile #64

Merged
merged 1 commit into from
Jun 7, 2024
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
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"]