2021-05-07 19:55:29 +00:00
|
|
|
DOCKER_TAG ?= vaultwarden_ldap_${USER}
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: test check release
|
|
|
|
|
|
|
|
# Default make target will run tests
|
|
|
|
.DEFAULT_GOAL = test
|
|
|
|
|
|
|
|
# Build debug version
|
2021-05-07 19:55:29 +00:00
|
|
|
target/debug/vaultwarden_ldap: src/
|
2020-07-09 19:04:05 +00:00
|
|
|
cargo build
|
|
|
|
|
|
|
|
# Build release version
|
2021-05-07 19:55:29 +00:00
|
|
|
target/release/vaultwarden_ldap: src/
|
2020-07-09 19:04:05 +00:00
|
|
|
cargo build --locked --release
|
|
|
|
|
2021-06-14 01:30:23 +00:00
|
|
|
.PHONY: build
|
|
|
|
build: debug
|
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
.PHONY: debug
|
2021-05-07 19:55:29 +00:00
|
|
|
debug: target/debug/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
.PHONY: release
|
2021-05-07 19:55:29 +00:00
|
|
|
release: target/release/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
# Run debug version
|
|
|
|
.PHONY: run-debug
|
2021-05-07 19:55:29 +00:00
|
|
|
run-debug: target/debug/vaultwarden_ldap
|
|
|
|
target/debug/vaultwarden_ldap
|
2020-07-09 19:04:05 +00:00
|
|
|
|
|
|
|
# Run all tests
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
cargo test
|
|
|
|
|
2021-07-23 22:28:19 +00:00
|
|
|
# Run bootstrapped integration test
|
2024-09-23 23:56:30 +00:00
|
|
|
.PHONY: itest-up
|
|
|
|
itest-up:
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2021-07-23 22:28:19 +00:00
|
|
|
-f itest/docker-compose.itest.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
build
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
-f itest/docker-compose.itest.yml \
|
|
|
|
up -d vaultwarden ldap
|
2024-09-23 23:56:30 +00:00
|
|
|
|
|
|
|
.PHONY: itest-run
|
|
|
|
itest-run:
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
-f itest/docker-compose.itest.yml \
|
|
|
|
run ldap_sync
|
2024-09-23 23:56:30 +00:00
|
|
|
|
|
|
|
.PHONY: itest-stop
|
|
|
|
itest-stop:
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose stop
|
2021-07-23 22:28:19 +00:00
|
|
|
|
2024-09-23 23:56:30 +00:00
|
|
|
.PHONY: itest
|
|
|
|
itest: itest-up itest-run itest-stop
|
|
|
|
|
2024-11-21 05:17:04 +00:00
|
|
|
# Run bootstrapped integration test for anonymous bind
|
|
|
|
.PHONY: itest-up-anon
|
|
|
|
itest-up-anon:
|
|
|
|
docker compose -f docker-compose.yml \
|
2024-11-21 07:17:57 +00:00
|
|
|
-f itest/docker-compose.itest-anon.yml \
|
2024-11-21 05:17:04 +00:00
|
|
|
build
|
|
|
|
docker compose -f docker-compose.yml \
|
2024-11-21 07:17:57 +00:00
|
|
|
-f itest/docker-compose.itest-anon.yml \
|
2024-11-21 05:17:04 +00:00
|
|
|
up -d vaultwarden ldap
|
|
|
|
|
|
|
|
.PHONY: itest-run-anon
|
|
|
|
itest-run-anon:
|
|
|
|
docker compose -f docker-compose.yml \
|
2024-11-21 07:17:57 +00:00
|
|
|
-f itest/docker-compose.itest-anon.yml \
|
|
|
|
run --rm ldap_sync
|
2024-11-21 05:17:04 +00:00
|
|
|
|
|
|
|
.PHONY: itest-stop-anon
|
|
|
|
itest-stop-anon:
|
|
|
|
docker compose stop
|
|
|
|
|
|
|
|
.PHONY: itest-anon
|
2024-11-21 07:17:57 +00:00
|
|
|
itest-anon: itest-up-anon itest-run-anon itest-stop-anon
|
2024-11-21 05:17:04 +00:00
|
|
|
|
2021-07-23 22:28:19 +00:00
|
|
|
# Run bootstrapped integration test using env for config
|
|
|
|
.PHONY: itest-env
|
|
|
|
itest-env:
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2021-07-23 22:28:19 +00:00
|
|
|
-f itest/docker-compose.itest-env.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
build
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
-f itest/docker-compose.itest-env.yml \
|
|
|
|
up -d vaultwarden ldap
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose -f docker-compose.yml \
|
2023-01-26 00:42:21 +00:00
|
|
|
-f itest/docker-compose.itest-env.yml \
|
|
|
|
run ldap_sync
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose stop
|
2021-07-23 22:28:19 +00:00
|
|
|
|
|
|
|
.PHONY: clean-itest
|
|
|
|
clean-itest:
|
2024-10-08 18:27:25 +00:00
|
|
|
docker compose down -v
|
2021-07-23 22:28:19 +00:00
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
# Installs pre-commit hooks
|
|
|
|
.PHONY: install-hooks
|
|
|
|
install-hooks:
|
|
|
|
pre-commit install --install-hooks
|
|
|
|
|
|
|
|
# Checks files for encryption
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
pre-commit run --all-files
|
|
|
|
|
|
|
|
# Checks that version matches the current tag
|
|
|
|
.PHONY: check-version
|
|
|
|
check-version:
|
|
|
|
./scripts/check-version.sh
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f ./target
|
|
|
|
|
2021-05-21 00:29:45 +00:00
|
|
|
.PHONY: docker-build-all
|
2024-07-12 22:46:37 +00:00
|
|
|
docker-build-all: docker-build
|
2021-05-21 00:29:45 +00:00
|
|
|
|
2020-07-09 19:04:05 +00:00
|
|
|
.PHONY: docker-build
|
|
|
|
docker-build:
|
|
|
|
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
|