Skip to content

Commit

Permalink
chore: Add .resources dir to all crates in ws
Browse files Browse the repository at this point in the history
In order to publish the crates individually, we need to attach our
resources to them. Currently this is mostly the proto files and the
tls (nobody) certificates.

This commit also adds `sync-files` to the root Makefile for ease of use.

Signed-off-by: Peter Neuroth <[email protected]>
  • Loading branch information
nepet authored and cdecker committed Aug 27, 2024
1 parent 62eec15 commit 83af938
Show file tree
Hide file tree
Showing 10 changed files with 1,227 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Cargo.lock linguist-generated=true -diff -merge

libs/gl-client/.resources/proto/** linguist-generated=true -diff -text -merge
libs/gl-client/.resources/tls/** linguist-generated=true -diff -text -merge
libs/gl-plugin/.resources/proto/** linguist-generated=true -diff -text -merge
libs/gl-plugin/.resources/tls/** linguist-generated=true -diff -text -merge
libs/gl-signerproxy/.resources/proto/** linguist-generated=true -diff -text -merge
libs/gl-signerproxy/.resources/tls/** linguist-generated=true -diff -text -merge
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ else
RSARCH = ${UNAME_M}
endif

# Path to workspace crates
LIBS = ${REPO_ROOT}/libs
GL_CLIENT = ${LIBS}/gl-client
GL_PLUGIN = ${LIBS}/gl-plugin
GL_SIGNERPROXY = ${LIBS}/gl-signerproxy

ARTIFACTS = \
.coverage

Expand Down Expand Up @@ -52,12 +58,24 @@ DOCKER_OPTIONS= \
-v /tmp/gltesting/cargo/registry:/opt/cargo/registry \
-v ${REPO_ROOT}:/repo

.PHONY: ensure-docker build-self check-self docker-image docs wheels

include libs/gl-client/Makefile
include libs/gl-client-py/Makefile
include libs/gl-testing/Makefile

# sync-files section
.PHONY: sync-files gl_client_sync-files gl_plugin_sync-files gl_signerproxy_sync-files
gl_client_sync-files:
$(MAKE) -C ${GL_CLIENT} sync-files

gl_plugin_sync-files:
$(MAKE) -C ${GL_PLUGIN} sync-files

gl_signerproxy_sync-files:
$(MAKE) -C ${GL_SIGNERPROXY} sync-files

sync-files: gl_client_sync-files gl_plugin_sync-files gl_signerproxy_sync-files

.PHONY: ensure-docker build-self check-self docker-image docs wheels

check-rs:
cargo test --all -- --test-threads=1

Expand Down
11 changes: 6 additions & 5 deletions libs/gl-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ REPO_ROOT=$(shell git rev-parse --show-toplevel)
endif

LIBS=${REPO_ROOT}/libs
GL_CLIENT_DIR=${LIBS}/gl-client
SELF_DIR=${LIBS}/gl-client

check-gl-client:
(cd ${GL_CLIENT_DIR}; cargo test)

# Syncronize proto and tls files into .resources dir
sync-files:
rm -rf ${GL_CLIENT_DIR}/.resource/proto .resource/tls
rsync -avr ${LIBS}/proto/ ${GL_CLIENT_DIR}/.resources/proto
rsync -avr ${LIBS}/tls/ ${GL_CLIENT_DIR}/.resources/tls
git add ${GL_CLIENT_DIR}/.resources
rsync -avr --delete --delete-excluded ${LIBS}/proto/ ${SELF_DIR}/.resources/proto
rsync -avr --delete --delete-excluded ${LIBS}/tls/ ${SELF_DIR}/.resources/tls
git add ${SELF_DIR}/.resources

Loading

0 comments on commit 83af938

Please sign in to comment.