Compare commits

...
Author SHA1 Message Date
dboreham 5697a39640 Merge pull request #112 from cerc-io/dboreham/version-command
Version command
2023-01-10 14:32:56 -07:00
dboreham df469786ca Add version to smoke test 2023-01-10 14:32:12 -07:00
dboreham d315941f21 Version command implemented 2023-01-10 14:23:59 -07:00
dboreham ae7a17cecd Make script file names consistent 2023-01-10 14:10:22 -07:00
dboreham 261b513d68 Initial implementation 2023-01-10 14:09:38 -07:00
dboreham 9278d09096 Merge pull request #111 from cerc-io/dboreham/simple-test
A simple test
2023-01-10 10:25:14 -07:00
dboreham b8b83768d8 Add trailing newline 2023-01-10 10:24:48 -07:00
dboreham ddd2ea2724 Add a simple smoke test and shiv build script 2023-01-10 10:24:04 -07:00
Zach 787a5228ea Merge pull request #107 from cerc-io/zramsay-patch-1
Update repository-list.txt (rebrand)
2023-01-10 10:18:31 -05:00
dboreham 2ea87a3a80 Merge pull request #108 from cerc-io/telackey/path
fix: import Path
2023-01-10 08:09:24 -07:00
telackey 8669a822df fix: import Path 2023-01-09 21:43:04 -06:00
Zach 738aa1907b Update repository-list.txt 2023-01-09 20:03:09 -05:00
Zach 4b1ca04620 Merge pull request #104 from cerc-io/zramsay-patch-2
Fix build; laconic-cns-cli -> laconic-registry-cli
2023-01-09 17:21:36 -05:00
zramsay 48dc431704 fix laconicd stack README 2023-01-09 15:39:23 -05:00
dboreham 2eee4d1fb2 Merge pull request #105 from cerc-io/dboreham/fix-env-var-error
Default the npm token env var
2023-01-09 13:37:48 -07:00
Zach 8e5d0d6c58 Update stack.yml 2023-01-09 15:35:03 -05:00
dboreham 9d9eb791d1 Default the npm token env var 2023-01-09 13:34:02 -07:00
14 changed files with 82 additions and 8 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ def command(ctx, include, exclude):
# TODO: make this configurable
container_build_env = {
"CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/",
"CERC_NPM_AUTH_TOKEN": os.environ["CERC_NPM_AUTH_TOKEN"],
"CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default="<token-not-supplied>"),
"CERC_REPO_BASE_DIR": dev_root_path
}
+1 -1
View File
@@ -1,5 +1,5 @@
contract
db
ipld-eth-db
eth-statediff-fill-service
go-ethereum-foundry
ipld-eth-beacon-db
+2 -2
View File
@@ -2,8 +2,8 @@ cerc-io/ipld-eth-db
cerc-io/go-ethereum
cerc-io/ipld-eth-server
cerc-io/eth-statediff-service
vulcanize/eth-statediff-fill-service
vulcanize/ipld-eth-db-validator
cerc-io/eth-statediff-fill-service
cerc-io/ipld-eth-db-validator
cerc-io/ipld-eth-beacon-indexer
cerc-io/ipld-eth-beacon-db
cerc-io/laconicd
+1 -1
View File
@@ -4,7 +4,7 @@ Instructions for deploying a local Laconic blockchain "fixturenet" for developme
## Clone required repositories
```
$ laconic-so setup-repositories --include cerc-io/laconicd,cerc-io/laconic-sdk,cerc-io/laconic-cns-cli
$ laconic-so setup-repositories --include cerc-io/laconicd,cerc-io/laconic-sdk,cerc-io/laconic-registry-cli
```
## Build the laconicd container
```
+3 -3
View File
@@ -3,9 +3,9 @@ name: laconicd-fixturenet
repos:
- cerc-io/laconicd
- cerc-io/laconic-sdk
- cerc-io/laconic-cns-cli
- cerc-io/laconic-registry-cli
containers:
- cerc/laconicd
- cerc/laconic-cns-cli
- cerc/laconic-registry-cli
pods:
- fixturenet-laconicd
- fixturenet-laconicd
+2
View File
@@ -0,0 +1,2 @@
# This file should be re-generated running: scripts/update-version-file.sh script
v1.0.6-alpha-ae7a17c
+1
View File
@@ -21,6 +21,7 @@ import sys
from python_on_whales import DockerClient
import click
import importlib
from pathlib import Path
from .util import include_exclude_check
+30
View File
@@ -0,0 +1,30 @@
# Copyright © 2023 Cerc
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
import click
import importlib
@click.command()
@click.pass_context
def command(ctx):
'''print tool version'''
# See: https://stackoverflow.com/a/20885799/1701505
from . import data
with importlib.resources.open_text(data, "version.txt") as version_file:
# TODO: code better version that skips comment lines
version_string = version_file.read().splitlines()[1]
print(f"Version: {version_string}")
+4
View File
@@ -0,0 +1,4 @@
# Builds the shiv "package" for distribution
# TODO: add build version/tag to filename
# TODO: add version info to code for version subcommand
shiv -c laconic-so -o package/laconic-so .
+2
View File
@@ -19,6 +19,7 @@ from app import setup_repositories
from app import build_containers
from app import build_npms
from app import deploy_system
from app import version
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@@ -49,3 +50,4 @@ cli.add_command(setup_repositories.command, "setup-repositories")
cli.add_command(build_containers.command, "build-containers")
cli.add_command(build_npms.command, "build-npms")
cli.add_command(deploy_system.command, "deploy-system")
cli.add_command(version.command, "version")
+3
View File
@@ -0,0 +1,3 @@
# Builds the shiv "package" for distribution
version_string=$( ./scripts/update_version_file.sh)
shiv -c laconic-so -o package/laconic-so-${version_string} .
+7
View File
@@ -0,0 +1,7 @@
version_file_name=./app/data/version.txt
echo "# This file should be re-generated running: scripts/update-version-file.sh script" > $version_file_name
tag_string=$( git describe --tags --abbrev=0 )
commit_string=$( git rev-parse --short HEAD )
version_string=${tag_string}-${commit_string}
echo ${version_string} >> $version_file_name
echo ${version_string}
+25
View File
@@ -0,0 +1,25 @@
# Basic simple test of stack-orchestrator functionality
echo "Running stack-orchestrator smoke test"
# Bit of a hack, test the most recent package
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
# Set a non-default repo dir
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
echo "Testing this package: $TEST_TARGET_SO"
echo "Test version command"
reported_version_string=$( $TEST_TARGET_SO version )
echo "Version reported is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR
# Pull an example small public repo to test we can pull a repo
$TEST_TARGET_SO setup-repositories --include cerc-io/laconic-sdk
# TODO: test building the repo into a container
# Build two example containers
# TODO:
$TEST_TARGET_SO build-containers --include cerc/builder-js,cerc/test-container
# Deploy the test container
$TEST_TARGET_SO deploy-system --include test up
# TODO: test that we can use the deployed container somehow
# Clean up
$TEST_TARGET_SO deploy-system --include test down
echo "Test passed"