Handling external `*.dar`s in CI
- LucianoOP
More of a survey than a question, but I’m interested to hear how devs are handling external
*.dardependencies, particularly wrt to CI and build process.I’ve locally got a
lib/folder and I symlink or drop*.darfiles which aredaml.yamldependenciesin there.However, this doesn’t work for our CI on github, because those files don’t exist. They need to be fetched from somewhere.
I would rather avoid checking-in the
*.darfiles into the source tree. - Richard_Kapolnai 1
In some refapps, we fetch the code and build them in the
github.commakecommand:digital-asset/ex-bond-issuance/blob/9a68bce68e0da516dce586c2b6c914497a2776c4/Makefile#L27
github.com- install-python-dependencies:
- cd scripts && pipenv sync
- ### DARS ###
- .PHONY: build-dars
- build-dars: $(MODELS_DAR) $(TRIGGERS_DAR)
- DAML_SRC=$(shell find src/ -name '*.daml')
- $(FINLIB_DAR):
- scripts/getfinlib.py $(SDK_VERSION)
- $(MODELS_DAR): $(DAML_SRC) daml.yaml $(FINLIB_DAR)
- daml build --output $@
- TRIGGERS_DAML_SRC=$(shell find triggers/src/ -name '*.daml')
- $(TRIGGERS_DAR): $(TRIGGERS_DAML_SRC) triggers/daml.yaml $(MODELS_DAR)
- cd triggers && daml build --output ../$@
digital-asset/ex-bond-issuance/blob/9a68bce68e0da516dce586c2b6c914497a2776c4/scripts/getfinlib.py
This file has been truncated. show original#!/usr/bin/env python3 # # Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Produces dar file `target/finlib-master-sdk-{daml_sdk_version}.dar' by fetching the source and building it. # Arguments: daml_sdk_version import logging from io import BytesIO from os import environ, getcwd, path, chdir, chmod, mkdir from subprocess import call from sys import argv from tempfile import mkdtemp from zipfile import ZipFile from shutil import copyfile # based on 'Cheat Sheet: Writing Python 2-3 compatible code' # from https://python-future.org/compatible_idioms.html