Skip to content

Commit

Permalink
Put back testNodeVersionDockerfile, but not for CI Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
aeifn committed May 14, 2024
1 parent bf6d20f commit 2117736
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ module.exports = function (grunt) {
stdout: true,
stderr: true,
},
testNodeVersionDockerfile: {
command: filename => {
const error = `Version defined in ${filename} is not matching package version of node.`;
const pkgVersion = grunt.template.process('<%= pkg.engines.node %>');
const dockerParse = "sed -n -e '/^ARG NODE_TAG/ s/.*=//p' " + filename;

return 'if [ "$(' + dockerParse + ')" != "' + pkgVersion + '" ]; then echo "' + error + '"; exit 1; fi;';
},
stdout: true,
stderr: true,
},
jest: {
command: 'npm run jest -- --ci',
stdout: true,
Expand Down Expand Up @@ -301,6 +312,7 @@ module.exports = function (grunt) {
grunt.registerTask('test', [
'exec:testNodeVersion:.node-version',
'exec:testNodeVersion:.nvmrc',
'exec:testNodeVersionDockerfile:./.docker/Dockerfile',
'eslint',
'stylelint',
'exec:jest',
Expand Down

0 comments on commit 2117736

Please sign in to comment.