Skip to content

Commit a1a2693

Browse files
committed
fix: cope with getting moddable submodule from agoric-labs
1 parent c4c44cb commit a1a2693

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.github/workflows/docker.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414
run: echo "GIT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV
1515
- name: Save SDK_VERSION
1616
run: echo "SDK_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
17-
- name: Save MODDABLE_COMMIT_HASH
17+
- name: Save MODDABLE_COMMIT_HASH, MODDABLE_URL
1818
run: |
1919
git submodule status packages/xsnap/moddable | \
2020
sed -ne 's/^.\([^ ]*\).*/MODDABLE_COMMIT_HASH=\1/p' >> $GITHUB_ENV
21+
sed -ne 's!^.*url = \(https://.*moddable\.git\).*!MODDABLE_URL=\1!p' .gitmodules >> $GITHUB_ENV
2122
- name: Build SDK image
2223
uses: elgohr/Publish-Docker-Github-Action@master
2324
with:
2425
name: agoric/agoric-sdk
2526
dockerfile: packages/deployment/Dockerfile.sdk
26-
buildargs: MODDABLE_COMMIT_HASH,GIT_REVISION
27+
buildargs: MODDABLE_COMMIT_HASH,MODDABLE_URL,GIT_REVISION
2728
username: ${{ secrets.DOCKER_USERNAME }}
2829
password: ${{ secrets.DOCKER_PASSWORD }}
2930
snapshot: true

packages/deployment/Dockerfile.sdk

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN make GIT_REVISION="$GIT_REVISION" MOD_READONLY= compile-go
1515
# The js build container
1616
FROM node:12-buster AS build-js
1717
ARG MODDABLE_COMMIT_HASH
18+
ARG MODDABLE_URL
1819

1920
WORKDIR /usr/src/agoric-sdk
2021
COPY . .
@@ -29,7 +30,7 @@ RUN cd golang/cosmos && yarn build:gyp
2930
RUN cd packages/cosmic-swingset && make install install-helper
3031

3132
# Check out the specified Moddable SDK version.
32-
RUN MODDABLE_COMMIT_HASH="$MODDABLE_COMMIT_HASH" yarn build
33+
RUN MODDABLE_COMMIT_HASH="$MODDABLE_COMMIT_HASH" MODDABLE_URL="$MODDABLE_URL" yarn build
3334

3435
# Remove dev dependencies.
3536
RUN rm -rf packages/xsnap/moddable

packages/deployment/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ VERSION := $(shell node -e 'console.log(require("../../package.json").version)'
66
TAG := $(if $(VERSION),$(VERSION),latest)
77
MODDABLE_COMMIT_HASH := $(shell git submodule status ../xsnap/moddable | \
88
sed -ne 's/^.\([^ ]*\).*/\1/p')
9+
MODDABLE_URL := $(shell sed -ne 's!^.* = \(https://.*moddable\.git\).*!\1!p' ../../.gitmodules)
910
GIT_REVISION := $(shell hash=$$(git rev-parse --short HEAD); \
1011
dirty=`git diff --quiet || echo -dirty`; \
1112
echo "$$hash$$dirty")
@@ -26,6 +27,7 @@ docker-build: docker-build-sdk docker-build-solo \
2627

2728
docker-build-sdk:
2829
docker build --build-arg=MODDABLE_COMMIT_HASH=$(MODDABLE_COMMIT_HASH) \
30+
--build-arg=MODDABLE_URL=$(MODDABLE_URL) \
2931
--build-arg=GIT_REVISION=$(GIT_REVISION) \
3032
-t $(REPOSITORY_SDK):$(TAG) --file=Dockerfile.sdk ../..
3133
docker tag $(REPOSITORY_SDK):$(TAG) $(REPOSITORY_SDK):latest

packages/xsnap/src/build.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ function exec(command, cwd, args = []) {
2626
(async () => {
2727
// Allow overriding of the checked-out version of the Moddable submodule.
2828
const moddableCommitHash = process.env.MODDABLE_COMMIT_HASH;
29+
const moddableUrl =
30+
process.env.MODDABLE_URL || 'https://github.com/agoric-labs/moddable.git';
2931

3032
if (moddableCommitHash) {
3133
// Do the moral equivalent of submodule update when explicitly overriding.
3234
if (!existsSync('moddable')) {
3335
await exec('git', '.', [
3436
'clone',
35-
'https://github.com/Moddable-OpenSource/moddable.git',
37+
// NOTE: We need to depend on cloning from agoric-labs.
38+
moddableUrl,
3639
'moddable',
3740
]);
3841
}

0 commit comments

Comments
 (0)