Skip to content

Commit

Permalink
refactor: added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Jun 26, 2024
1 parent 67ae425 commit 0445d5c
Showing 1 changed file with 78 additions and 44 deletions.
122 changes: 78 additions & 44 deletions run-build-for-gh-deps.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,78 @@
cd node_modules/@edx/
rm -rf frontend-platform
git clone -b dcoa/design-tokens-support --single-branch https://github.com/eduNEXT/frontend-platform.git
cd frontend-platform
npm ci
npm run build

cp -a dist/. ../frontend-platform/
cd ..
find frontend-platform -mindepth 1 -maxdepth 1 ! -name 'dist' -delete
mv frontend-platform/dist/* frontend-platform/
rm -rf frontend-platform/dist
cd ../..

cd node_modules/@openedx/
rm -rf frontend-build
git clone -b dcoa/design-tokens-support --single-branch https://github.com/eduNEXT/frontend-build.git
cd frontend-build
npm ci

cp -a dist/. ../frontend-build-dist
cd ..
cp -a frontend-build-dist/. frontend-build/
rm -rf frontend-build-dist
cd ../..

cd node_modules/@openedx/
rm -rf paragon
mkdir -p paragon
cd paragon
npm pack @openedx/[email protected]
tar -xzf openedx-paragon-23.0.0-alpha.2.tgz --strip-components=1
rm openedx-paragon-23.0.0-alpha.2.tgz
cd ../../..

cd node_modules/@edx/
rm -rf frontend-component-header
git clone -b Peter_Kulko/support-design-tokens --single-branch https://github.com/PKulkoRaccoonGang/frontend-component-header.git
cd frontend-component-header
npm i --force
npm run build
cd ../../..

fedx-scripts webpack
#!/bin/bash

log() {
echo "=============================== $1 ==============================="
}

run_command() {
echo "\$ $1"
eval $1
}

log "Starting deployment script"
run_command "pwd"

# frontend-platform
log "Processing frontend-platform"
run_command "cd node_modules/@edx/" || exit
log "Current directory: $(pwd)"
run_command "rm -rf frontend-platform"
run_command "git clone -b dcoa/design-tokens-support --single-branch https://github.com/eduNEXT/frontend-platform.git"
run_command "cd frontend-platform" || exit
log "Current directory: $(pwd)"
run_command "npm ci"
run_command "npm run build"
run_command "cp -a dist/. ../frontend-platform/"
run_command "cd .." || exit
log "Current directory: $(pwd)"
run_command "find frontend-platform -mindepth 1 -maxdepth 1 ! -name 'dist' -delete"
run_command "mv frontend-platform/dist/* frontend-platform/"
run_command "rm -rf frontend-platform/dist"
run_command "cd ../.." || exit
log "Current directory: $(pwd)"

# frontend-build
log "Processing frontend-build"
run_command "cd node_modules/@openedx/" || exit
log "Current directory: $(pwd)"
run_command "rm -rf frontend-build"
run_command "git clone -b dcoa/design-tokens-support --single-branch https://github.com/eduNEXT/frontend-build.git"
run_command "cd frontend-build" || exit
log "Current directory: $(pwd)"
run_command "npm ci"
run_command "cd ../../.." || exit
log "Current directory: $(pwd)"

# paragon
log "Processing paragon"
run_command "ls -l"
run_command "cd node_modules/@openedx/" || exit
log "Current directory: $(pwd)"
run_command "rm -rf paragon"
run_command "mkdir -p paragon"
run_command "cd paragon" || exit
log "Current directory: $(pwd)"
run_command "npm pack @openedx/[email protected]"
run_command "tar -xzf openedx-paragon-23.0.0-alpha.2.tgz --strip-components=1"
run_command "rm openedx-paragon-23.0.0-alpha.2.tgz"
run_command "cd ../../.." || exit
log "Current directory: $(pwd)"

# frontend-component-header
log "Processing frontend-component-header"
run_command "cd node_modules/@edx/" || exit
log "Current directory: $(pwd)"
run_command "rm -rf frontend-component-header"
run_command "git clone -b Peter_Kulko/support-design-tokens --single-branch https://github.com/PKulkoRaccoonGang/frontend-component-header.git"
run_command "cd frontend-component-header" || exit
log "Current directory: $(pwd)"
run_command "npm i --force"
run_command "npm run build"
run_command "cd ../../.." || exit
log "Current directory: $(pwd)"

# webpack
log "Running webpack"
run_command "fedx-scripts webpack"

log "Deployment script finished."

0 comments on commit 0445d5c

Please sign in to comment.