Skip to content

Commit 326f7d2

Browse files
anvinrajtimrulebosch
authored andcommitted
Workflow updates for SDP Gateway integration.
Signed-off-by: Timothy Rule (VM/EMT3) <Timothy.Rule@de.bosch.com>
1 parent e7048c1 commit 326f7d2

1 file changed

Lines changed: 41 additions & 43 deletions

File tree

Taskfile.yml

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,18 @@ tasks:
452452
STATIC_FILES: '{{.STATIC_FILES | default ""}}'
453453

454454
FMI_x64: Fmi-{{.FMI_VERSION}}-windows-x64
455-
SIMER_WIN: Simer-{{.MODELC_VERSION}}-windows
456455
MODELC_x64: ModelC-{{.MODELC_VERSION}}-windows-x64
457456
MODELC_x86: ModelC-{{.MODELC_VERSION}}-windows-x86
458457

459458
OUT_DIR: '{{.OUT_DIR | default "out"}}'
460459
DIST: '{{.OUT_DIR}}/dist'
461460
RELEASE: '{{.OUT_DIR}}/release/{{.FMU_NAME}}'
462-
RESOURCES: '{{.OUT_DIR}}/release/{{.FMU_NAME}}/resources'
463-
BINARIES: '{{.OUT_DIR}}/release/{{.FMU_NAME}}/binaries'
464-
LICENSES: '{{.OUT_DIR}}/release/{{.FMU_NAME}}/licenses'
465-
MODELS: '{{.OUT_DIR}}/release/{{.FMU_NAME}}/resources/model'
466-
TOOLS: '{{.OUT_DIR}}/release/{{.FMU_NAME}}/resources/tools'
461+
RESOURCES: '{{.RELEASE}}/resources'
462+
BINARIES: '{{.RELEASE}}/binaries'
463+
LICENSES: '{{.RELEASE}}/licenses'
464+
MODELS: '{{.RESOURCES}}/model'
465+
TOOLS: '{{.RESOURCES}}/tools'
466+
SIMER_WIN: '{{.TOOLS}}/simer-windows'
467467
SIM_MODELS: '{{.OUT_DIR}}/sim/model'
468468
DOWNLOADS: '{{.OUT_DIR}}/downloads'
469469

@@ -478,61 +478,59 @@ tasks:
478478
- rm -rf {{.DIST}} {{.RELEASE}}
479479
- mkdir -p {{.DIST}} {{.RESOURCES}} {{.BINARIES}} {{.LICENSES}} {{.MODELS}} {{.TOOLS}} {{.DOWNLOADS}} {{.TMP_DIR}}
480480
- |
481+
echo "=== Packaging {{.FMU_NAME}} FMU ==="
481482
{{- if or (hasPrefix "2.0" .MODELC_VERSION) (hasPrefix "2.1" .MODELC_VERSION) (hasPrefix "2.2" .MODELC_VERSION) }}
482-
# ModelC (<2.3.7) : Redis + ModelC extraction
483-
[ -z "$AR_USER" ] && echo "AR_USER not set" && exit 1 || true
484-
[ -z "$AR_TOKEN" ] && echo "AR_TOKEN not set" && exit 1 || true
483+
# ModelC (<2.3.7) : Redis + ModelC extraction
485484
486-
# Download Redis
487-
curl --retry 5 --retry-delay 3 --fail --location \
488-
-u "$AR_USER:$AR_TOKEN" \
489-
-o {{.TMP_DIR}}/Redis-x64-3.0.504.zip \
490-
https://artifactory.boschdevcloud.com/artifactory/lab000141-emthacks-generic-local/customer/any/redis/winx64/Redis-x64-3.0.504.zip
485+
echo "Copying Redis runtime files..."
486+
# Redis files from simer-windows
487+
rsync -av --exclude='x64/' --exclude='x86/' --exclude='simer.exe' {{.OUT_DIR}}/sim/bin/. {{.TOOLS}}/Redis-x64-3.0.504/
491488
492-
mkdir -p {{.TOOLS}}/Redis-x64-3.0.504
493-
unzip -q -o {{.TMP_DIR}}/Redis-x64-3.0.504.zip -d {{.TOOLS}}/Redis-x64-3.0.504
489+
echo "Downloading ModelC dependencies..."
490+
# Download ModelC x64
491+
echo "Downloading ModelC x64..."
492+
curl --retry 5 --retry-delay 3 --fail --location \
493+
-o {{.TMP_DIR}}/{{.MODELC_x64}}.zip \
494+
https://github.com/boschglobal/dse.modelc/releases/download/v{{.MODELC_VERSION}}/{{.MODELC_x64}}.zip
494495
495-
# Download ModelC x64
496-
curl --retry 5 --retry-delay 3 --fail --location \
497-
-o {{.TMP_DIR}}/{{.MODELC_x64}}.zip \
498-
https://github.com/boschglobal/dse.modelc/releases/download/v{{.MODELC_VERSION}}/{{.MODELC_x64}}.zip
496+
# Download ModelC x86
497+
echo "Downloading ModelC x86..."
498+
curl --retry 5 --retry-delay 3 --fail --location \
499+
-o {{.TMP_DIR}}/{{.MODELC_x86}}.zip \
500+
https://github.com/boschglobal/dse.modelc/releases/download/v{{.MODELC_VERSION}}/{{.MODELC_x86}}.zip
499501
500-
unzip -q -o {{.TMP_DIR}}/{{.MODELC_x64}}.zip -d {{.TMP_DIR}}
501-
mkdir -p {{.TOOLS}}/modelc/windows/x64
502-
cp -r {{.TMP_DIR}}/{{.MODELC_x64}}/. {{.TOOLS}}/modelc/windows/x64/
503502
504-
# Download ModelC x86
505-
curl --retry 5 --retry-delay 3 --fail --location \
506-
-o {{.TMP_DIR}}/{{.MODELC_x86}}.zip \
507-
https://github.com/boschglobal/dse.modelc/releases/download/v{{.MODELC_VERSION}}/{{.MODELC_x86}}.zip
503+
echo "Extracting ModelC packages..."
504+
unzip -q -o {{.TMP_DIR}}/{{.MODELC_x64}}.zip -d {{.TMP_DIR}}
505+
mkdir -p {{.TOOLS}}/modelc/windows/x64
506+
cp -r {{.TMP_DIR}}/{{.MODELC_x64}}/. {{.TOOLS}}/modelc/windows/x64/
508507
509-
unzip -q -o {{.TMP_DIR}}/{{.MODELC_x86}}.zip -d {{.TMP_DIR}}
510-
mkdir -p {{.TOOLS}}/modelc/windows/x86
511-
cp -r {{.TMP_DIR}}/{{.MODELC_x86}}/. {{.TOOLS}}/modelc/windows/x86/
508+
unzip -q -o {{.TMP_DIR}}/{{.MODELC_x86}}.zip -d {{.TMP_DIR}}
509+
mkdir -p {{.TOOLS}}/modelc/windows/x86
510+
cp -r {{.TMP_DIR}}/{{.MODELC_x86}}/. {{.TOOLS}}/modelc/windows/x86/
512511
513-
cp -r {{.TOOLS}}/modelc/windows/x64/licenses/. {{.LICENSES}}/
512+
echo "Copying license files..."
513+
cp -r {{.TOOLS}}/modelc/windows/x64/licenses/. {{.LICENSES}}/
514514
{{- else }}
515-
516-
# ModelC (>=2.3.7) : Simer bundle
517-
518-
curl --retry 5 --retry-delay 3 --fail --location \
519-
-o {{.TMP_DIR}}/{{.SIMER_WIN}}.zip \
520-
https://github.com/boschglobal/dse.modelc/releases/download/v{{.MODELC_VERSION}}/{{.SIMER_WIN}}.zip
521-
522-
unzip -q -o {{.TMP_DIR}}/{{.SIMER_WIN}}.zip -d {{.TOOLS}}/simer-windows
523-
515+
# ModelC (>=2.3.7) : Simer bundle
516+
mkdir -p {{.SIMER_WIN}}
517+
echo "Copying Simer-windows binaries..."
518+
cp -r {{.OUT_DIR}}/sim/bin/. {{.SIMER_WIN}}/bin
519+
echo "Copying license files..."
520+
cp -r {{.OUT_DIR}}/sim/licenses/. {{.LICENSES}}
524521
{{- end }}
525522
526-
# Copy models
523+
echo "Copying simulation models..."
527524
cp -r {{.SIM_MODELS}}/. {{.MODELS}}/
528525
526+
echo "Downloading FMI runtime dependencies..."
529527
# Download FMI runtime
530528
curl --retry 5 --retry-delay 3 --fail --location \
531529
-o {{.DOWNLOADS}}/{{.FMI_x64}}.zip \
532530
https://github.com/boschglobal/dse.fmi/releases/download/v{{.FMI_VERSION}}/{{.FMI_x64}}.zip
533531
534532
mkdir -p {{.BINARIES}}/win64
535-
533+
echo "Extracting FMI runtime libraries..."
536534
unzip -j -o {{.DOWNLOADS}}/{{.FMI_x64}}.zip \
537535
{{.FMI_x64}}/bin/libmodelc.dll \
538536
-d {{.BINARIES}}/win64
@@ -558,7 +556,7 @@ tasks:
558556
{{- $sf := trim $s }}
559557
cp {{$.PWD}}/{{$sf}} {{$.RESOURCES}}
560558
{{- end }}
561-
559+
echo "Creating FMU package..."
562560
# Create FMU
563561
(
564562
cd {{.RELEASE}} || exit 1

0 commit comments

Comments
 (0)