Compare commits

...
9 Commits
Author SHA1 Message Date
dboreham 8a4f189286 Merge pull request #234 from cerc-io/dboreham/lirewine-builds
Add support for lirewine npm package build and consumption

Former-commit-id: ebe1dfa4bf
2023-03-24 02:54:21 -06:00
dboreham aa01feb98a Fix up script and npm list
Former-commit-id: e6b91acdea
2023-03-24 02:52:37 -06:00
dboreham c4e3aa54f1 Remove trailing whitespace
Former-commit-id: 2e7ef1e52e
2023-03-24 02:31:19 -06:00
dboreham 364a71d694 Support the @lirewine npm scope
Former-commit-id: 9e322203e9
2023-03-24 02:30:04 -06:00
dboreham d96a6def14 Add lirewine repos and npms
Former-commit-id: 870a987760
2023-03-24 02:08:56 -06:00
dboreham 1a75a270f5 Merge pull request #232 from cerc-io/dboreham/foundry-debian-container
Foundry debian-based container

Former-commit-id: 76029d24de
2023-03-23 17:46:42 -06:00
David Boreham 23fab04ec8 Fix filename
Former-commit-id: 06288fd9e1
2023-03-23 16:09:27 -06:00
David Boreham 4420f45924 Build foundry with Debian base container
Former-commit-id: 21e9f96771
2023-03-23 16:03:35 -06:00
dboreham dac22b19b7 Update version
Former-commit-id: d5fd880bba
2023-03-22 21:35:48 -06:00
7 changed files with 25 additions and 19 deletions
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version> # Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local # Runs build-npm-package.sh after first fixing up yarn.lock to use a local
# npm registry for all packages in a spcific scope (currently @cerc-io) # npm registry for all packages in a spcific scope (currently @cerc-io and @lirewine)
if [ -n "$CERC_SCRIPT_DEBUG" ]; then if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x set -x
fi fi
@@ -17,18 +17,21 @@ fi
set -e set -e
local_npm_registry_url=$1 local_npm_registry_url=$1
package_publish_version=$2 package_publish_version=$2
# TODO: make this a paramater and allow a list of scopes # If we need to handle an additional scope, add it to the list below:
npm_scope_for_local="@cerc-io" npm_scopes_to_handle=("@cerc-io" "@lirewine")
# We need to configure the local registry for npm_scope_for_local in ${npm_scopes_to_handle[@]}
npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url}
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
# Find the set of dependencies from the specified scope
mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]')
echo "Fixing up dependencies"
for package in "${dependencies_from_scope[@]}"
do do
echo "Fixing up package ${package}" # We need to configure the local registry
yarn-local-registry-fixup.sh $package ${local_npm_registry_url} npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url}
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
# Find the set of dependencies from the specified scope
mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]')
echo "Fixing up dependencies in scope ${npm_scope_for_local}"
for package in "${dependencies_from_scope[@]}"
do
echo "Fixing up package ${package}"
yarn-local-registry-fixup.sh $package ${local_npm_registry_url}
done
done done
echo "Running build" echo "Running build"
build-npm-package.sh ${local_npm_registry_url} ${package_publish_version} build-npm-package.sh ${local_npm_registry_url} ${package_publish_version}
@@ -22,8 +22,8 @@ set -e
# Get the name of this package from package.json since we weren't passed that # Get the name of this package from package.json since we weren't passed that
package_name=$( cat package.json | jq -r .name ) package_name=$( cat package.json | jq -r .name )
local_npm_registry_url=$1 local_npm_registry_url=$1
npm config set @lirewine:registry ${local_npm_registry_url}
npm config set @cerc-io:registry ${local_npm_registry_url} npm config set @cerc-io:registry ${local_npm_registry_url}
npm config set @lirewine:registry ${local_npm_registry_url}
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
# First check if the version of this package we're trying to build already exists in the registry # First check if the version of this package we're trying to build already exists in the registry
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball ) package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Build a local version of the foundry-rs/foundry image # Build a local version of the foundry-rs/foundry image
docker build -t cerc/foundry:local ${CERC_REPO_BASE_DIR}/foundry docker build -t cerc/foundry:local -f ${CERC_REPO_BASE_DIR}/foundry/Dockerfile-debian ${CERC_REPO_BASE_DIR}/foundry
@@ -40,8 +40,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# RUN su node -c "npm install -g <your-package-list-here>" # RUN su node -c "npm install -g <your-package-list-here>"
# Configure the local npm registry # Configure the local npm registry
RUN npm config set @lirewine:registry ${CERC_NPM_URL} \ RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \
&& npm config set @cerc-io:registry ${CERC_NPM_URL} \
&& npm config set @lirewine:registry ${CERC_NPM_URL} \ && npm config set @lirewine:registry ${CERC_NPM_URL} \
&& npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} && npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
+3 -2
View File
@@ -1,4 +1,5 @@
gem
laconic-sdk laconic-sdk
debug
laconic-registry-cli laconic-registry-cli
gem
debug
crypto
+3
View File
@@ -19,3 +19,6 @@ vulcanize/assemblyscript
cerc-io/eth-probe cerc-io/eth-probe
cerc-io/tx-spammer cerc-io/tx-spammer
dboreham/foundry dboreham/foundry
lirewine/gem
lirewine/debug
lirewine/crypto
+1 -1
View File
@@ -1,2 +1,2 @@
# This file should be re-generated running: scripts/update-version-file.sh script # This file should be re-generated running: scripts/update-version-file.sh script
v1.0.28-33bbbcc v1.0.29-5fca9bd