Commit 67e089c2 authored by Tobias Munk's avatar Tobias Munk

fixed asset building, fixed config loader for common-debug, use debug in all app-types (if enabled)

parent 2f216935
Pipeline #76829 passed with stage
in 10 minutes and 9 seconds
......@@ -54,7 +54,7 @@ VOLUME /app/runtime /app/web/assets /mnt/storage
# Build assets (skipped on first build in dist-upgrade)
RUN if [ -z "$BUILD_NO_INSTALL" ]; then \
APP_NO_CACHE=1 APP_LANGUAGES=en APP_USER_FROM_EMAIL=build@Dockerfile APP_ADMIN_EMAIL=build@Dockerfile yii asset/compress config/assets.php web/bundles/config.php; \
PHP_USER_ID=0 APP_NO_CACHE=1 APP_LANGUAGES=en APP_USER_FROM_EMAIL=build@Dockerfile APP_ADMIN_EMAIL=build@Dockerfile yii asset/compress config/assets.php web/bundles/config.php; \
fi
# Install crontab from application config
......
......@@ -102,13 +102,20 @@ if (getenv('MYSQL_ATTR_SSL_CA')) {
// update Redis increment counter according to queue_manager db (workaround)
Event::on(Queue::class, Queue::EVENT_BEFORE_PUSH, function ($event) {
// added directly to the SQL query, since param binding
$table_name = getenv('DATABASE_TABLE_PREFIX').'queue_manager';
if (Yii::$app->cache->get('queue_id_synced') !== true) {
$lastQueueIdSql = <<<SQL
SELECT `AUTO_INCREMENT`
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '{table_prefix}queue_manager'
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '{$table_name}'
SQL;
$lastModelId = Yii::$app->db->createCommand($lastQueueIdSql, ['{table_prefix}'=>getenv('DATABASE_TABLE_PREFIX')])->queryScalar();
$lastModelId = Yii::$app->db
->createCommand($lastQueueIdSql)
->queryScalar();
if (!is_int($lastModelId)) {
throw new \yii\db\Exception("Invalid increment ({$lastModelId}) for Redis queue");
}
Yii::$app->redis->set("queue.message_id", $lastModelId);
Yii::$app->cache->set('queue_id_synced', true);
Yii::info("Synced redis queue id with database ($lastModelId)");
......
......@@ -41,6 +41,7 @@ return call_user_func(function () {
"{$configDir}/".APP_TYPE.'.php' => true,
"{$configDir}/common-".YII_ENV.'.php' => false,
"{$configDir}/".APP_TYPE.'-'.YII_ENV.'.php' => false,
"{$configDir}/common-".((YII_DEBUG)?'debug':'release').'.php' => false,
"{$configDir}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false,
];
......@@ -55,7 +56,6 @@ return call_user_func(function () {
// Merge configurations
$config = [];
//var_dump($configFiles);exit;
Yii::trace($configFiles, __METHOD__);
foreach ($configFiles as $file => $isRequired) {
if (!is_file($file)) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment