Skip to content

Commit

Permalink
Fix github actions cockroachdb setup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Aug 7, 2024
1 parent 7d5a8ea commit f8c3af4
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 232 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
curl -sL 'https://github.com/pluralsh/plural-cli/releases/download/v0.5.18/plural-cli_0.5.18_Linux_amd64.tar.gz' | tar xzvf -
chmod +x plural
cp plural /usr/local/bin/plural
- run: make install-cockroach
- run: make testup
- name: Restore dependencies cache
uses: actions/cache@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ yarn-error.log*
cert.pem
key.pem


/test-certs/

.vscode
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DKR_HOST ?= dkr.plural.sh
dep ?= forge-core
GIT_COMMIT ?= abe123
TARGETARCH ?= amd64
COCKROACH_VSN ?= v24.1.3

help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down Expand Up @@ -48,7 +49,22 @@ else
docker push $(DKR_HOST)/plural/${APP_NAME}:$(APP_VSN)
endif

testup: ## sets up dependent services for test
install-cockroach:
sudo curl https://binaries.cockroachdb.com/cockroach-$(COCKROACH_VSN).linux-amd64.tgz | tar -xz && \
sudo cp -i cockroach-$(COCKROACH_VSN).linux-amd64/cockroach /usr/local/bin/ && \
sudo mkdir -p /usr/local/lib/cockroach && \
sudo cp -i cockroach-$(COCKROACH_VSN).linux-amd64/lib/libgeos.so /usr/local/lib/cockroach/ && \
sudo cp -i cockroach-$(COCKROACH_VSN).linux-amd64/lib/libgeos_c.so /usr/local/lib/cockroach/ && \
cockroach version

setup-certs:
mkdir test-certs && \
cockroach cert create-ca --certs-dir test-certs --ca-key test-certs/ca.key && \
cockroach cert create-node localhost 127.0.0.1 --certs-dir test-certs --ca-key test-certs/ca.key && \
cockroach cert create-client root --certs-dir test-certs --ca-key test-certs/ca.key && \
cockroach cert list --certs-dir test-certs

testup: setup-certs ## sets up dependent services for test
docker compose up -d

testdown: ## tear down test dependencies
Expand Down
19 changes: 0 additions & 19 deletions test-certs/ca.crt

This file was deleted.

27 changes: 0 additions & 27 deletions test-certs/ca.key

This file was deleted.

19 changes: 0 additions & 19 deletions test-certs/client.plrl.crt

This file was deleted.

27 changes: 0 additions & 27 deletions test-certs/client.plrl.key

This file was deleted.

19 changes: 0 additions & 19 deletions test-certs/client.plural.crt

This file was deleted.

27 changes: 0 additions & 27 deletions test-certs/client.plural.key

This file was deleted.

19 changes: 0 additions & 19 deletions test-certs/client.root.crt

This file was deleted.

27 changes: 0 additions & 27 deletions test-certs/client.root.key

This file was deleted.

20 changes: 0 additions & 20 deletions test-certs/node.crt

This file was deleted.

27 changes: 0 additions & 27 deletions test-certs/node.key

This file was deleted.

0 comments on commit f8c3af4

Please sign in to comment.