Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker deployment for heroku #157

Merged
merged 3 commits into from Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 0 additions & 18 deletions generators/heroku/index.js
Expand Up @@ -7,7 +7,6 @@ const util = require('util');
const os = require('os');
const HerokuGenerator = require('generator-jhipster/generators/heroku');
const constants = require('generator-jhipster/generators/generator-constants');
const { getBase64Secret } = require('generator-jhipster/generators/utils');

const execCmd = util.promisify(ChildProcess.exec);

Expand Down Expand Up @@ -140,23 +139,6 @@ module.exports = class extends HerokuGeneratorOverride {
addHerokuDependencies() {
// Nothing to do here right now
},
addJwtSecretEnvironmentVariable() {
const done = this.async();
const jwtSecret = getBase64Secret(null, 64);
const setJwtSecretCommand = `heroku config:set JWT_SECRET=${jwtSecret} --app ${this.herokuAppName}`;

const child = ChildProcess.exec(setJwtSecretCommand, (err, stdout, stderr) => {
if (err) {
this.abort = true;
this.log.error(err);
}
done();
});

child.stdout.on('data', data => {
this.log(data.toString());
});
},
};
return Object.assign(phaseFromJHipster, jhipsterMicronautDefaultPhaseSteps);
}
Expand Down
8 changes: 1 addition & 7 deletions generators/heroku/templates/application-heroku.yml.ejs
Expand Up @@ -32,14 +32,8 @@
micronaut:
server:
port: ${PORT:8080}
security:
token:
jwt:
signatures:
secret:
generator:
secret: ${JWT_SECRET}
<%_ if (useOkta) { _%>
security:
oauth2:
enabled: true
clients:
Expand Down
2 changes: 1 addition & 1 deletion generators/server/templates/pom.xml.ejs
Expand Up @@ -782,7 +782,7 @@ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
<entrypoint>
<shell>sh</shell>
<option>-c</option>
<arg>chmod +x /entrypoint.sh &amp;&amp; sync &amp;&amp; /entrypoint.sh</arg>
<arg>/entrypoint.sh</arg>
</entrypoint>
<ports>
<port>8080</port>
Expand Down