Skip to content

Commit

Permalink
fix: empty commit for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed Jul 14, 2022
1 parent 59cffe9 commit aba992b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/create-dockerfile/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/create-dockerfile/index.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/actions/create-dockerfile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ async function action() {

if (!stubs[preset]) core.error(new Error('preset doesnt exists'))

const template = _.template(stubs[preset])
const { defaultValues, files = {}, stub } = stubs[preset]

for (const filename of _.keys(files)) {
fs.writeFileSync(path.join(process.cwd(), filename), files[filename]);
}

const template = _.template(stub)

const content = template({
generatedAt: new Date().toISOString(),
...defaultValues,
});

fs.writeFileSync(path.join(process.cwd(), "Dockerignore"), content);
Expand Down
1 change: 1 addition & 0 deletions src/actions/create-dockerfile/stubs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
spa: require('./spa'),
python: require('./python'),
javascript: require('./javascript'),
}
2 changes: 1 addition & 1 deletion src/actions/create-dockerfile/stubs/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ENTRYPOINT ["python"]
CMD ["app.py"]
`,

defaults: {
defaultValues: {
image: 'alpine',
tag: '17',
labels: [],
Expand Down
2 changes: 1 addition & 1 deletion src/actions/create-dockerfile/stubs/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ENTRYPOINT ["python"]
CMD ["app.py"]
`,

defaults: {
defaultValues: {
image: 'python',
tag: '3.7',
labels: [],
Expand Down
2 changes: 1 addition & 1 deletion src/actions/create-dockerfile/stubs/spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENTRYPOINT ["nginx"]
CMD ["-g daemon off;"]
`,

defaults: {},
defaultValues: {},

files: {
'nginx.conf': `
Expand Down

0 comments on commit aba992b

Please sign in to comment.