@@ -11,20 +11,28 @@ const __dirname = path.dirname(__filename);
1111
1212const readmePath = path . join ( __dirname , '../README.md' ) ;
1313const installScriptPath = path . join ( __dirname , './install.sh' ) ;
14+ const dockerfilePath = path . join ( __dirname , '../ci/image.Dockerfile' ) ;
1415
1516let readme = fs . readFileSync ( readmePath , 'utf8' ) ;
1617let installScript = fs . readFileSync ( installScriptPath , 'utf8' ) ;
18+ let dockerfile = fs . readFileSync ( dockerfilePath , 'utf8' ) ;
1719
1820// Regex to match version string inside /cli/v{{version}}/scripts/
1921const versionInInstallReadme = / ( \/ c l i \/ ) v \d + \. \d + \. \d + (?: - [ 0 - 9 A - Z a - z . - ] + ) ? ( \/ s c r i p t s \/ ) / g;
2022
2123// Regex to match the LATEST_VERSION defined in the install.sh script
2224const versionInInstallScript = / ( L A T E S T _ V E R S I O N = " ) v \d + \. \d + \. \d + (?: - [ 0 - 9 A - Z a - z . - ] + ) ? ( " ) / g;
2325
26+ // Regex to match ARG VERSION=<version> in the Dockerfile
27+ const versionInDockerfile = / ( A R G V E R S I O N = ) \d + \. \d + \. \d + (?: - [ 0 - 9 A - Z a - z . - ] + ) ? / g;
28+
2429readme = readme . replace ( versionInInstallReadme , `$1v${ newVersion } $2` ) ;
2530fs . writeFileSync ( readmePath , readme ) ;
2631
2732installScript = installScript . replace ( versionInInstallScript , `$1v${ newVersion } $2` ) ;
2833fs . writeFileSync ( installScriptPath , installScript ) ;
2934
35+ dockerfile = dockerfile . replace ( versionInDockerfile , `$1${ newVersion } ` ) ;
36+ fs . writeFileSync ( dockerfilePath , dockerfile ) ;
37+
3038console . log ( `Updated install script and install command with ${ newVersion } ` ) ;
0 commit comments