Skip to content

Commit

Permalink
Merge pull request #247 from entando/ENG-4717-fix-images-docker-compose
Browse files Browse the repository at this point in the history
[ENG-4717] Rollback using Entando specific image. Enable Entando Docke…
  • Loading branch information
avdev4j authored Apr 18, 2023
2 parents 22362ff + 81991e2 commit 744135a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 104 deletions.
4 changes: 0 additions & 4 deletions generators/generator-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const MBKNOR_JACKSON_JSONSCHEMA_VERSION = '1.0.34';
const SPRING_BOOT_VERSION = '2.7.3';
const ENTANDO_BUNDLE_BOM_VERSION = '7.2.0-ENG-4717-PR-15';
const ENTANDO_KEYCLOAK_DOCKER_IMAGE = 'entando/entando-keycloak:7.2.0-ENGPM-540-rc1';
const ENTANDO_POSTGRESQL_DOCKER_IMAGE = 'entando/entando-postgres-rocky:14.1.0';
const ENTANDO_MYSQL_DOCKER_IMAGE = 'entando/entando-mysql-rocky:8.0.28';

module.exports = {
SQL_DB_OPTIONS,
Expand All @@ -41,6 +39,4 @@ module.exports = {
SPRING_BOOT_VERSION,
ENTANDO_BUNDLE_BOM_VERSION,
ENTANDO_KEYCLOAK_DOCKER_IMAGE,
ENTANDO_POSTGRESQL_DOCKER_IMAGE,
ENTANDO_MYSQL_DOCKER_IMAGE,
};
4 changes: 2 additions & 2 deletions generators/server/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const entandoServerFiles = {
],
},
{
condition: generator => generator.devDatabaseTypePostgres,
condition: generator => generator.databaseTypePostgres,
path: DOCKER_DIR,
templates: ['postgresql.yml'],
},
{
condition: generator => generator.devDatabaseTypeMysql,
condition: generator => generator.databaseTypeMysql,
path: DOCKER_DIR,
templates: ['mysql.yml'],
},
Expand Down
2 changes: 0 additions & 2 deletions generators/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module.exports = class extends ServerGenerator {
setupEntandoServerconsts() {
this.ENTANDO_BUNDLE_BOM_VERSION = constants.ENTANDO_BUNDLE_BOM_VERSION;
this.ENTANDO_KEYCLOAK_DOCKER_IMAGE = constants.ENTANDO_KEYCLOAK_DOCKER_IMAGE;
this.ENTANDO_POSTGRESQL_DOCKER_IMAGE = constants.ENTANDO_POSTGRESQL_DOCKER_IMAGE;
this.ENTANDO_MYSQL_DOCKER_IMAGE = constants.ENTANDO_MYSQL_DOCKER_IMAGE;
this.SPRING_BOOT_VERSION = constants.SPRING_BOOT_VERSION;
},
};
Expand Down
2 changes: 1 addition & 1 deletion generators/server/templates/src/main/docker/mysql.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
version: '<%= DOCKER_COMPOSE_FORMAT_VERSION %>'
services:
mysql:
image: <%= ENTANDO_MYSQL_DOCKER_IMAGE %>
image: <%= DOCKER_MYSQL %>
volumes:
- ./config/mysql:/etc/mysql/conf.d
# - ~/volumes/jhipster/<%= baseName %>/mysql/:/var/lib/mysql/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
version: '<%= DOCKER_COMPOSE_FORMAT_VERSION %>'
services:
postgresql:
image: <%= ENTANDO_POSTGRESQL_DOCKER_IMAGE %>
image: <%= DOCKER_POSTGRESQL %>
# volumes:
# - ~/volumes/jhipster/<%= baseName %>/postgresql/:/var/lib/postgresql/data/
environment:
Expand Down
94 changes: 0 additions & 94 deletions test/server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,100 +270,6 @@ describe('Subgenerator server of entando JHipster blueprint', () => {
});
});

describe('With mysql as dev database', () => {
before(done => {
helpers
.run('generator-jhipster/generators/server', {}, { createEnv: EnvironmentBuilder.createEnv })
.withOptions({
'from-cli': true,
skipInstall: true,
blueprint: 'entando',
skipChecks: true,
})
.withGenerators([
[
require('../generators/server/index'), // eslint-disable-line global-require
'jhipster-entando:server',
path.join(__dirname, '../generators/server/index'),
],
])
.withPrompts({
baseName: appBaseName,
packageName: 'com.mycompany.myapp',
applicationType: 'microservice',
databaseType: 'sql',
devDatabaseType: 'mysql',
prodDatabaseType: 'mysql',
cacheProvider: 'ehcache',
authenticationType: 'oauth2',
enableTranslation: true,
nativeLanguage: 'en',
languages: ['fr', 'de'],
buildTool: 'maven',
rememberMeKey: '2bb60a80889aa6e6767e9ccd8714982681152aa5',
microserviceDependencies: 'entando',
})
.on('end', done);
});

it('creates expected files for the blueprint', () => {
assert.file(expectedFiles.server);
});

it('creates expected MYSQL docker-compose file', () => {
const dockerComposeFile = expectedFiles['entando-mysql'];
assert.file(dockerComposeFile);
assert.fileContent(dockerComposeFile, entandoConstants.ENTANDO_MYSQL_DOCKER_IMAGE);
});
});

describe('With postgresql as dev database', () => {
before(done => {
helpers
.run('generator-jhipster/generators/server', {}, { createEnv: EnvironmentBuilder.createEnv })
.withOptions({
'from-cli': true,
skipInstall: true,
blueprint: 'entando',
skipChecks: true,
})
.withGenerators([
[
require('../generators/server/index'), // eslint-disable-line global-require
'jhipster-entando:server',
path.join(__dirname, '../generators/server/index'),
],
])
.withPrompts({
baseName: appBaseName,
packageName: 'com.mycompany.myapp',
applicationType: 'microservice',
databaseType: 'sql',
devDatabaseType: 'postgresql',
prodDatabaseType: 'postgresql',
cacheProvider: 'ehcache',
authenticationType: 'oauth2',
enableTranslation: true,
nativeLanguage: 'en',
languages: ['fr', 'de'],
buildTool: 'maven',
rememberMeKey: '2bb60a80889aa6e6767e9ccd8714982681152aa5',
microserviceDependencies: 'entando',
})
.on('end', done);
});

it('creates expected files for the blueprint', () => {
assert.file(expectedFiles.server);
});

it('creates expected MYSQL docker-compose file', () => {
const dockerComposeFile = expectedFiles['entando-postgresql'];
assert.file(dockerComposeFile);
assert.fileContent(dockerComposeFile, entandoConstants.ENTANDO_POSTGRESQL_DOCKER_IMAGE);
});
});

describe('With Infinispan as cache configuration', () => {
before(done => {
helpers
Expand Down

0 comments on commit 744135a

Please sign in to comment.