-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scripts for packing heimdall lite (#2082)
Signed-off-by: Christopher Andrew Hinchey <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
18c728c
commit ee5f0d4
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
ECHO OFF | ||
|
||
SET CYPRESS_INSTALL_BINARY=0 | ||
SET PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
|
||
SET original_dir=%cd% | ||
ECHO %original_dir% | ||
|
||
IF DEFINED npm_config_heimdall ( | ||
CD %npm_config_heimdall%/apps/frontend/ | ||
) ELSE ( | ||
CD ../heimdall2/apps/frontend/ | ||
) | ||
|
||
IF DEFINED npm_config_branch ( | ||
CALL git switch %npm_config_branch% || EXIT /B %ERRORLEVEL% | ||
) ELSE ( | ||
CALL git switch master || EXIT /B %ERRORLEVEL% | ||
) | ||
|
||
ECHO Executing - git fetch ... | ||
CALL git fetch || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - git pull ... | ||
CALL git pull || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - yarn install ... | ||
CALL yarn install || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - yarn pack ... | ||
CALL yarn pack || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Finished generating the tarball | ||
|
||
CD %original_dir% | ||
|
||
ECHO Executing - npm install remote ... | ||
CALL npm i || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - npm install local ... | ||
|
||
IF DEFINED npm_config_heimdall ( | ||
FOR /f "tokens=*" %%a IN ('dir /b %npm_config_heimdall%\apps\frontend\mitre-heimdall-lite-v*.tgz') DO ( | ||
SET THIS_TAR_ZIP=%npm_config_heimdall%\libs\hdf-converters\%%a | ||
) | ||
) ELSE ( | ||
FOR /f "tokens=*" %%a IN ('dir /b ..\heimdall2\apps\frontend\mitre-heimdall-lite-v*.tgz') DO ( | ||
SET THIS_TAR_ZIP=..\heimdall2\apps\frontend\%%a | ||
) | ||
) | ||
CALL npm i %THIS_TAR_ZIP% || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Executing - npm run prepack ... | ||
CALL npm run prepack || EXIT /B %ERRORLEVEL% | ||
|
||
ECHO Install of local heimdall-lite complete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit # abort on nonzero exitstatus | ||
set -o nounset # abort on unbound variable | ||
set -o pipefail # don't hide errors within pipes | ||
|
||
ORIGINAL=$PWD | ||
echo $ORIGINAL | ||
|
||
cd "${npm_config_heimdall:-../heimdall2}" | ||
cd apps/frontend | ||
|
||
git switch "${npm_config_branch:-master}" | ||
|
||
echo "Executing - git fetch ..." | ||
git fetch | ||
|
||
echo "Executing - git pull ..." | ||
git pull | ||
|
||
echo "Executing - yarn install ..." | ||
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn install | ||
|
||
echo "Executing - yarn pack ..." | ||
yarn pack | ||
|
||
echo "Finished generating the tarball" | ||
|
||
cd "$ORIGINAL" | ||
|
||
echo "Executing - npm install remote ..." | ||
npm i | ||
|
||
echo "Executing - npm install local ..." | ||
npm i "${npm_config_heimdall:-../heimdall2}/apps/frontend/mitre-heimdall-lite-v"*".tgz" | ||
|
||
echo "Executing - npm run prepack ..." | ||
npm run prepack | ||
|
||
echo "Install of local heimdall-lite complete." |