Skip to content

Commit b4e9aec

Browse files
authored
Use daml.exe instead of da.exe (#1)
1 parent 3cded90 commit b4e9aec

8 files changed

+61
-49
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
command: |
7676
export PATH=${HOME}/.daml/bin:${PATH}
7777
daml build -o target/supplychain.dar
78-
daml test --junit target/daml-test-reports/daml-test.xml src/main/daml/DA/RefApps/SupplyChain/Scenarios.daml
78+
daml test --junit target/daml-test-reports/daml-test.xml --files src/main/daml/DA/RefApps/SupplyChain/Scenarios.daml
7979
- save_cache:
8080
paths:
8181
- ~/.daml

Dockerfile-navigator

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
#
2+
# Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
16
FROM ubuntu:18.04
27

8+
ARG sdk_version=0.13.10
9+
310
WORKDIR /home/sdk
411

512
COPY ui-backend.conf frontend-config.js /home/sdk/
13+
COPY scripts/install-daml.sh /home/sdk/
614

7-
RUN /bin/bash -c "apt-get update --no-show-upgraded && apt-get install curl openjdk-8-jdk -y"
8-
RUN /bin/bash -c "curl -L https://github.com/digital-asset/daml/releases/download/v0.12.21/daml-sdk-0.12.21-linux.tar.gz -o daml-sdk-0.12.21-linux.tar.gz && \
9-
tar -zxvf daml-sdk-0.12.21-linux.tar.gz && \
10-
cd sdk-0.12.21 && \
11-
./install.sh && \
12-
cd - && \
13-
rm -rf sdk-0.12.21"
15+
RUN /bin/bash -c "apt-get update --no-show-upgraded && apt-get install wget openjdk-8-jdk -y"
16+
RUN /home/sdk/install-daml.sh ${sdk_version}
1417

1518
EXPOSE 7500
1619

Dockerfile-sandbox

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
#
2+
# Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
16
FROM ubuntu:18.04
27

8+
ARG sdk_version=0.13.10
9+
310
WORKDIR /home/sdk
411

512
COPY target/supplychain.dar /home/sdk/
13+
COPY scripts/install-daml.sh /home/sdk/
614

7-
RUN /bin/bash -c "apt-get update --no-show-upgraded && apt-get install curl openjdk-8-jdk -y"
8-
RUN /bin/bash -c "curl -L https://github.com/digital-asset/daml/releases/download/v0.12.21/daml-sdk-0.12.21-linux.tar.gz -o daml-sdk-0.12.21-linux.tar.gz && \
9-
tar -zxvf daml-sdk-0.12.21-linux.tar.gz && \
10-
cd sdk-0.12.21 && \
11-
./install.sh && \
12-
cd - && \
13-
rm -rf sdk-0.12.21"
15+
RUN /bin/bash -c "apt-get update --no-show-upgraded && apt-get install wget openjdk-8-jdk -y"
16+
RUN /home/sdk/install-daml.sh ${sdk_version}
1417

1518
EXPOSE 7600
1619

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ _**Note:** If you change the DAML models locally, you need to run re-run this co
3131
### Starting the App
3232

3333
Running on local machine requires three terminal tabs:
34-
1. Run Sandbox:
34+
1. Run Sandbox and Navigator:
3535
```bash
36-
daml sandbox -- --port 7600 --scenario DA.RefApps.SupplyChain.Scenarios:setup target/supplychain.dar
36+
daml start
3737
```
38-
2. Run Navigator Backend:
39-
```bash
40-
daml navigator -- server localhost 7600 --port 7500 --config-file ui-backend.conf
41-
```
42-
3. Run bots:
38+
39+
2. Run bots:
4340
```bash
4441
java -jar target/supplychain-0.0.1-SNAPSHOT.jar -p 7600
4542
```

da.yaml

-19
This file was deleted.

daml.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44
#
55

6-
sdk-version: 0.12.21
6+
sdk-version: 0.13.10
77
name: supplychain
88
source: src/main/daml/DA/RefApps/SupplyChain/Scenarios.daml
99
scenario: DA.RefApps.SupplyChain.Scenarios:setup

scripts/install-daml.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
#!/usr/bin/env bash
3+
#
4+
# Copyright (c) 2019, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
if [ $# -eq 0 ]
9+
then
10+
echo "ERROR: No parameters given! Usage: ${0} SDK_VERSION"
11+
exit 1
12+
fi
13+
14+
SDK_VERSION="${1}"
15+
16+
if [ -f "${HOME}/.daml/bin/daml" ]
17+
then
18+
echo "Skipping DAML SDK installation as it is already installed..."
19+
else
20+
cd ${HOME}
21+
wget https://github.com/digital-asset/daml/releases/download/v${SDK_VERSION}/daml-sdk-${SDK_VERSION}-linux.tar.gz
22+
tar -zxvf daml-sdk-${SDK_VERSION}-linux.tar.gz
23+
cd sdk-${SDK_VERSION}
24+
./install.sh
25+
cd ${HOME}
26+
rm -rf sdk-${SDK_VERSION}
27+
fi

scripts/upgrade-sdk.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ echo "SDK version is $SDK_VERSION"
2323
echo "modifying ${PROJECT_DIR}/da.yaml"
2424
sed -e "s/sdk-version: .*$/sdk-version: $SDK_VERSION/" -i "${PROJECT_DIR}/da.yaml"
2525

26+
echo "SDK version is $SDK_VERSION"
2627
echo "modifying ${PROJECT_DIR}/daml.yaml"
2728
sed -e "s/sdk-version: .*$/sdk-version: $SDK_VERSION/" -i "${PROJECT_DIR}/daml.yaml"
2829

29-
# echo "modifying ${PROJECT_DIR}/pom.xml"
30-
# sed -e "s/<daml-sdk.version>.*<\/daml-sdk.version>$/<daml-sdk.version>10$SDK_VERSION<\/daml-sdk.version>/" -i "${PROJECT_DIR}/pom.xml"
30+
echo "modifying ${PROJECT_DIR}/pom.xml"
31+
sed -e "s/<daml-sdk.version>.*<\/daml-sdk.version>$/<daml-sdk.version>10$SDK_VERSION<\/daml-sdk.version>/" -i "${PROJECT_DIR}/pom.xml"
3132

32-
# echo "modifying ${PROJECT_DIR}/Dockerfile-navigator"
33-
# sed -e "s/FROM digitalasset\/daml-sdk:.*$/FROM digitalasset\/daml-sdk:$SDK_VERSION-master/" -i "${PROJECT_DIR}/Dockerfile-navigator"
33+
echo "modifying ${PROJECT_DIR}/Dockerfile-navigator"
34+
sed -e "s/ARG sdk_version=.*/ARG sdk_version=$SDK_VERSION/" -i "${PROJECT_DIR}/Dockerfile-navigator"
3435

35-
# echo "modifying ${PROJECT_DIR}/Dockerfile-sandbox"
36-
# sed -e "s/FROM digitalasset\/daml-sdk:.*$/FROM digitalasset\/daml-sdk:$SDK_VERSION-master/" -i "${PROJECT_DIR}/Dockerfile-sandbox"
36+
echo "modifying ${PROJECT_DIR}/Dockerfile-sandbox"
37+
sed -e "s/ARG sdk_version=.*/ARG sdk_version=$SDK_VERSION/" -i "${PROJECT_DIR}/Dockerfile-sandbox"
3738

3839
echo "modifying ${PROJECT_DIR}/.circleci/config.yml"
39-
sed -e "s/image: digitalasset\/daml-sdk:.*$/image: digitalasset\/daml-sdk:$SDK_VERSION-circleci-master/" -i "${PROJECT_DIR}/.circleci/config.yml"
40+
sed -e "s/_version: \".*\"$/_version: \"$SDK_VERSION\"/" -i "${PROJECT_DIR}/.circleci/config.yml"

0 commit comments

Comments
 (0)