Skip to content

Commit

Permalink
Added scripts for packing heimdall lite (#2082)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Andrew Hinchey <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
ChrisHinchey and mergify[bot] authored Dec 6, 2023
1 parent 18c728c commit ee5f0d4
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
56 changes: 56 additions & 0 deletions pack-heimdall-lite.bat
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.
40 changes: 40 additions & 0 deletions pack-heimdall-lite.sh
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."

0 comments on commit ee5f0d4

Please sign in to comment.