Skip to content

Commit

Permalink
Merge pull request kellerkinderDE#42 from kellerkinderDE/feature/skip…
Browse files Browse the repository at this point in the history
…-config-without-database

Skip system config updates without a database
  • Loading branch information
jochenmanz authored Mar 2, 2023
2 parents c6983cb + 705c927 commit 45e87a4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
30 changes: 15 additions & 15 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1675710064,
"narHash": "sha256-dJtezby4DAtB0YAjJtbBEP5VTRLJQIefweSfQ4l4g/k=",
"lastModified": 1677721981,
"narHash": "sha256-vIXNwm98F2u5z9CLfWP72MJxaseVDBqnGhQGAFyxbLA=",
"owner": "cachix",
"repo": "devenv",
"rev": "d97ea8c7d91678683b321d93694ca805ac7978e0",
"rev": "8454b85158482d93dcc3f20b77fef5272313d127",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -87,11 +87,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1675673983,
"narHash": "sha256-8hzNh1jtiPxL5r3ICNzSmpSzV7kGb3KwX+FS5BWJUTo=",
"lastModified": 1677587185,
"narHash": "sha256-zYT66MAYwctAQqI5VBw3LbBXiSKdB8vuMAqCGG8onbE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5a350a8f31bb7ef0c6e79aea3795a890cf7743d4",
"rev": "68196a61c26748d3e53a6803de3d2f8c69f27831",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -126,11 +126,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1675765101,
"narHash": "sha256-LzRXMMKSw+5rdwsfX5Q65l4tHmVW0vk/BqHcYrTWlxE=",
"lastModified": 1677386056,
"narHash": "sha256-7zjqCeKW7YWjqR6EsUOqd2JzyCioYGVbbqmTgHTytBs=",
"owner": "fossar",
"repo": "nix-phps",
"rev": "8257ca974415ec44389e5173bcf668f0f6199626",
"rev": "98c16af0f9c329de8d62ef4817a5356c7685fffb",
"type": "github"
},
"original": {
Expand All @@ -150,11 +150,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1675688762,
"narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=",
"lastModified": 1677722096,
"narHash": "sha256-7mjVMvCs9InnrRybBfr5ohqcOz+pyEX8m22C1XsDilg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ab608394886fb04b8a5df3cb0bab2598400e3634",
"rev": "61a3511668891c68ebd19d40122150b98dc2fe3b",
"type": "github"
},
"original": {
Expand All @@ -173,11 +173,11 @@
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
Expand Down
25 changes: 21 additions & 4 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,20 @@ let
${pkgs.coreutils}/bin/sleep 1
done
while ! [[ $($DEVENV_PROFILE/bin/mysql shopware -s -N -e 'SHOW DATABASES LIKE "shopware";') ]] ; do
${pkgs.coreutils}/bin/sleep 1
done
TABLE=$(mysql shopware -s -N -e 'SHOW TABLES LIKE "system_config";')
if [[ $TABLE == "" ]]; then
echo "Table system_config is missing. Run >updateSystemConfig< manually to ensure the dev status of your setup!"
${pkgs.coreutils}/bin/sleep infinity
fi
${scriptUpdateConfig}
echo -e "Startup completed"
${pkgs.coreutils}/bin/sleep infinity
'';

Expand All @@ -82,8 +92,7 @@ let
echo "Updating system config"
if [ ! -f "$VENDOR" ] || [ ! -f "$CONSOLE" ];
then
if [ ! -f "$VENDOR" ] || [ ! -f "$CONSOLE" ]; then
echo "Vendor folder or console not found. Please run composer install."
exit 1
fi
Expand All @@ -96,7 +105,7 @@ let
# default config
$CONSOLE system:config:set core.mailerSettings.emailAgent "" || exit 1
echo "System config core.mailerSettings.emailAgent set to ''''"
echo "System config core.mailerSettings.emailAgent set to '''"
'';

importDbHelper = pkgs.writeScript "importDbHelper" ''
Expand Down Expand Up @@ -410,11 +419,19 @@ in {
SHOPWARE_ES_HOSTS = "127.0.0.1";
SHOPWARE_ES_THROW_EXCEPTION = "1";
})
(lib.mkIf config.services.rabbitmq.enable {
RABBITMQ_NODENAME = "rabbit@localhost"; # 127.0.0.1 can't be used as rabbitmq can't set short node name
})
];

# Processes
processes.entryscript.exec = "${entryScript}";

# Config related scripts
scripts.updateSystemConfig.exec = ''
${scriptUpdateConfig}
'';

# Symfony related scripts
scripts.cc.exec = ''
CONSOLE=${config.env.DEVENV_ROOT}/bin/console
Expand Down

0 comments on commit 45e87a4

Please sign in to comment.