Skip to content

Commit 6786fe8

Browse files
liranmaudanimrod-becker
authored andcommitted
Adding md5sum for the agents
build_windows_agent.bat and build_agent_linux.sh - Adding md5sum for the agents platform_upgrade.js: - Typo - Add src/deploy/Linux/Build-Package.sh
1 parent bb3b60d commit 6786fe8

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

src/deploy/Linux/Build-Package.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
echo "=====> nvm install"
4+
source ~/.bashrc || exit 1
5+
source "$NVM_DIR/nvm.sh" || exit 1
6+
nvm install || exit 1
7+
8+
echo "=====> get package for git commit $GIT_COMMIT"
9+
NB_VERSION=$(node << EOF
10+
'use strict';
11+
const fs = require('fs');
12+
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
13+
const git = process.env.GIT_COMMIT || 'DEVONLY';
14+
const version = pkg.version.split('-')[0] + '-' + git.slice(0, 7);
15+
console.log(version);
16+
EOF
17+
)
18+
echo "=====> version $NB_VERSION"
19+
20+
echo "=====> update tar noobaa-NVA-${NB_VERSION}.tar.gz"
21+
gunzip build/public/noobaa-NVA-${NB_VERSION}.tar.gz || exit 1
22+
mv build/linux/noobaa-setup-${NB_VERSION}* build/public/ || exit 1
23+
mv build/windows/noobaa-setup-${NB_VERSION}.exe* build/public/ || exit 1
24+
tar --transform='s:^:noobaa-core/:' \
25+
-rf build/public/noobaa-NVA-${NB_VERSION}.tar \
26+
build/public/noobaa-setup-${NB_VERSION} \
27+
build/public/noobaa-setup-${NB_VERSION}.md5 \
28+
build/public/noobaa-setup-${NB_VERSION}.exe \
29+
build/public/noobaa-setup-${NB_VERSION}.exe.md5 \
30+
|| exit 1
31+
gzip build/public/noobaa-NVA-${NB_VERSION}.tar

src/deploy/Linux/build_agent_linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ verbose mkdir dist
9898
verbose cp ../../src/deploy/Linux/setup.sh ./dist/
9999
verbose mv noobaa-installer ./dist/noobaa-installer
100100
verbose ../../src/deploy/makeself/makeself.sh ./dist noobaa-setup-$current_package_version $current_package_version ./setup.sh
101+
md5sum noobaa-setup-$current_package_version | awk '{print $1}' > noobaa-setup-${current_package_version}.md5
101102
verbose popd
102103

103104
echo "Done: build/linux/noobaa-setup-$current_package_version"
104-
exit 0
105+
exit 0

src/deploy/build_windows_agent.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ if exist "%SIGNTOOL_PATH%" (
111111
"%SIGNTOOL_PATH%" sign /v /s my /t http://timestamp.comodoca.com /a %FINAL_SETUP_FILE_NAME% || exit 1
112112
)
113113

114+
md5sum %FINAL_SETUP_FILE_NAME% | awk '{print $1}' > %FINAL_SETUP_FILE_NAME%.md5
115+
114116
echo "%FINAL_SETUP_FILE_NAME% installer available under build\windows"
115117

116118
cd ..\..

src/upgrade/platform_upgrade.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ async function copy_new_code() {
457457
await fs_utils.full_dir_copy(NEW_VERSION_DIR, CORE_DIR);
458458
}
459459

460-
// make sure that all the file which are requiered by the new version (.env, etc.) are in the new dir
460+
// make sure that all the file which are required by the new version (.env, etc.) are in the new dir
461461
async function prepare_new_dir() {
462462
await _build_dotenv();
463463
await _create_packages_md5();
@@ -472,7 +472,7 @@ async function _build_dotenv() {
472472
_.pick(old_env, DOTENV_VARS_FROM_OLD_VER),
473473
);
474474

475-
dbg.log0('UPGRADE: genertaing .env file for new version:', new_env);
475+
dbg.log0('UPGRADE: generating .env file for new version:', new_env);
476476

477477
await fs.writeFileAsync(`${NEW_VERSION_DIR}/.env`, dotenv.stringify(new_env));
478478
}
@@ -815,7 +815,7 @@ async function set_upgrade_info(new_upgrade_info) {
815815
try {
816816
const upgrade_data = JSON.stringify(new_upgrade_info);
817817
await fs.writeFileAsync(UPGRADE_INFO_FILE_PATH, upgrade_data);
818-
dbg.log0('UPGRADE: upgrade info updated successfuly with upgrade_info =', new_upgrade_info);
818+
dbg.log0('UPGRADE: upgrade info updated successfully with upgrade_info =', new_upgrade_info);
819819
} catch (err) {
820820
dbg.error(`got unexpected error when writing upgrade info file ${UPGRADE_INFO_FILE_PATH}`, err);
821821
}

0 commit comments

Comments
 (0)