Skip to content

Commit

Permalink
Deploy alembic.ini in Vagrant
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed May 18, 2024
1 parent 4f98e9d commit 7528897
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Vagrant.configure(2) do |config|

badges.vm.synced_folder '.', '/vagrant', type: "sshfs"
badges.vm.synced_folder ".", "/home/vagrant/tahrir", type: "sshfs"
# badges.vm.synced_folder "../tahrir-api", "/home/vagrant/tahrir-api", type: "sshfs"

badges.vm.provider :libvirt do |libvirt|
libvirt.cpus = 2
Expand Down
51 changes: 51 additions & 0 deletions devel/ansible/roles/dev/files/alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# A generic, single database configuration.

[alembic]
# path to migration scripts
script_location = tahrir_api:migrations

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

# I guess we'll just assume that tahrir is in the same parent directory?
sqlalchemy.url = sqlite:////%(here)s/tahrir.db


# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
9 changes: 6 additions & 3 deletions devel/ansible/roles/dev/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@
owner: vagrant


- name: copy the secret.ini file
- name: copy the secret.ini and alembic.ini files
copy:
src: secret.ini
dest: /home/vagrant/secret.ini
src: "{{ item }}"
dest: /home/vagrant/{{ item }}
mode: 0644
owner: vagrant
group: vagrant
loop:
- secret.ini
- alembic.ini

- name: get the fedora badges
git:
Expand Down

0 comments on commit 7528897

Please sign in to comment.