Migration makefile.
parent
b7a724b5d6
commit
b9b130e008
8
makefile
8
makefile
|
@ -43,12 +43,6 @@ register:; $(Q)./bin/authc user register $(NAME) $(EMAIL)
|
||||||
validate:; $(Q)./bin/authc user validate $(NAME) $(ACTIVATION_KEY)
|
validate:; $(Q)./bin/authc user validate $(NAME) $(ACTIVATION_KEY)
|
||||||
get-user:; $(Q)./bin/authc user get $(NAME) $(LOGIN_OPT)
|
get-user:; $(Q)./bin/authc user get $(NAME) $(LOGIN_OPT)
|
||||||
|
|
||||||
USER_DB ?= /tmp/migration-authd-user-db.txt
|
|
||||||
$(USER_DB): ; ./bin/migration-filter.awk < /tmp/usrdb | grep -a -v "^INVALID" | sort | uniq > $(USER_DB)
|
|
||||||
migration-file: $(USER_DB)
|
|
||||||
migrate-user:; ./bin/authc user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
|
|
||||||
migrate-all-users:; ./bin/authc migration-script $(USER_DB) $(LOGIN_OPT)
|
|
||||||
|
|
||||||
SERVICE ?= 'auth'
|
SERVICE ?= 'auth'
|
||||||
RESOURCE ?= '*'
|
RESOURCE ?= '*'
|
||||||
UID ?= 1000
|
UID ?= 1000
|
||||||
|
@ -89,3 +83,5 @@ wipe-db:
|
||||||
|
|
||||||
release:
|
release:
|
||||||
make build-server OPTS="--progress --release"
|
make build-server OPTS="--progress --release"
|
||||||
|
|
||||||
|
-include migration.mk
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# This is the migration makefile.
|
||||||
|
#
|
||||||
|
# WHAT IS NEEDED FOR THE MIGRATION:
|
||||||
|
#
|
||||||
|
# - $(SQLDB): a dump of the SQL database (format: login password domain)
|
||||||
|
#
|
||||||
|
# HOW MIGRATION WORKS, STEP BY STEP (`migration` rule):
|
||||||
|
#
|
||||||
|
# 1. migration-file -> create the $(USER_DB) file
|
||||||
|
# 2. migrate-all-users -> migrate all user accounts
|
||||||
|
#
|
||||||
|
# AFTER THE `migration` RULE: go to the dnsmanagerd repository and follow instructions.
|
||||||
|
|
||||||
|
# DB from SQL, format: login password domain
|
||||||
|
SQLDB ?= /tmp/usrdb
|
||||||
|
|
||||||
|
USER_DB ?= /tmp/migration-authd-user-db.txt
|
||||||
|
|
||||||
|
$(USER_DB):
|
||||||
|
./bin/migration-filter.awk < $(SQLDB) | grep -a -v "^INVALID" | sort | uniq > $(USER_DB)
|
||||||
|
|
||||||
|
migration-file: $(USER_DB)
|
||||||
|
|
||||||
|
migrate-user:
|
||||||
|
./bin/authc user migrate $(NAME) $(PASSWORD_HASH) $(LOGIN_OPT)
|
||||||
|
|
||||||
|
migrate-all-users:
|
||||||
|
./bin/authc migration-script $(USER_DB) $(LOGIN_OPT)
|
||||||
|
|
||||||
|
migration: migration-file migrate-all-users
|
Loading…
Reference in New Issue