-
Notifications
You must be signed in to change notification settings - Fork 21
/
dev_build.ps1
62 lines (51 loc) · 1.37 KB
/
dev_build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Sync file
# Requires
# - YARN
# - Nodes
# - GIT
$base = "../"
$branch = "develop"
#$repos = "openimis-fe-contract_js", "openimis-fe-calculation_js"
$repos = "openimis-fe-contribution_plan_js","openimis-fe-admin_js"
$fe_target = "C:\inetpub\wwwroot\IMIs_formalSector\Front"
# create base if not existing
if ( -Not (Test-Path -Path $base) ){
mkdir $base
}
# create target if not existing
if ( -Not (Test-Path -Path $fe_target) ){
mkdir $fe_target
}
cd $base
if ( -Not (Test-Path -Path openimis-fe_js) ){
git clone https://github.com/openimis/openimis-fe_js.git --quiet
}
cd openimis-fe_js
# get the other file from git
git checkout $branch --quiet -f
git pull --quiet
cd ..
$repos | ForEach-Object -Process {
# FIXMEfetch the repository if not existing
if ( -Not (Test-Path -Path $_ )){
git clone https://github.com/openimis/$_.git --quiet
}
# get the other file from git
cd $_
git checkout $branch --quiet -f
git pull --quiet
# do the yarn link
yarn build
cd ..
}
# build the front end
cd openimis-fe_js
node openimis-config.js ./openimis.fs.json
Get-Content ./modules-unlinks.txt | Invoke-Expression
Get-Content ./modules-removes.txt | Invoke-Expression
Get-Content ./modules-installs.txt | Invoke-Expression
Get-Content ./modules-links.txt | Invoke-Expression
yarn install
yarn build
Remove-Item $fe_target/* -Recurse -Force
Copy-Item ./build/* $fe_target/ -Recurse -Force