Skip to content

Commit

Permalink
Fix docker deployment for heroku (#157)
Browse files Browse the repository at this point in the history
* fix docker deployment/docker file

* do not set JWT_SECRET env variable for heroku anymore

* fix linting errors
  • Loading branch information
atomfrede committed Aug 11, 2020
1 parent 5022d06 commit 1bc66a3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
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

0 comments on commit 1bc66a3

Please sign in to comment.