Skip to content
Snippets Groups Projects
Commit c4b3f8c5 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Resolve "inject the client specs when releasing with CI" (!302)

* fix(#278): update client specs when producing a new client
parent 14b9f289
No related branches found
No related tags found
1 merge request!302Resolve "`--chain=<file>` should allow to redefine the client specs"
Pipeline #39449 passed
...@@ -436,9 +436,17 @@ build_raw_specs: ...@@ -436,9 +436,17 @@ build_raw_specs:
- export FEATURES="--features $RUNTIME --no-default-features" - export FEATURES="--features $RUNTIME --no-default-features"
- echo "FEATURES = $FEATURES" - echo "FEATURES = $FEATURES"
- apt-get update - apt-get update
- apt-get install -y clang cmake protobuf-compiler - apt-get install -y clang cmake protobuf-compiler jq
# Print chainspec to file # Print chainspec to file
- cargo xtask print-spec $NETWORK_RELEASE > ${RUNTIME}.json - cargo xtask print-spec $NETWORK_RELEASE > ${RUNTIME}-printed.json
# Merge client specs into chainspec file (to update bootnodes for example)
# 1. Download yq to create a json client spec file
- wget https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_arm64 -O yq
- chmod +x ./yq
# 2. YML -> JSON for the client specs
- cat node/specs/${RUNTIME}_client-specs.yaml | ./yq --output-format json > node/specs/${RUNTIME}_client-specs.json
# 3. Merge the client spec file into chainspec file and create the final spec file (e.g. gdev.json)
- jq -s '.[0] * .[1]' node/specs/${RUNTIME}_client-specs.json ${RUNTIME}-printed.json > ${RUNTIME}.json
# Produce raw spec file # Produce raw spec file
- mkdir -p $CI_PROJECT_DIR/release - mkdir -p $CI_PROJECT_DIR/release
- cargo run -Zgit=shallow-deps ${FEATURES} -- build-spec --chain=${RUNTIME}.json --disable-default-bootnode --raw > $RELEASE_FILE_RAW_SPEC - cargo run -Zgit=shallow-deps ${FEATURES} -- build-spec --chain=${RUNTIME}.json --disable-default-bootnode --raw > $RELEASE_FILE_RAW_SPEC
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment