Skip to content
Snippets Groups Projects
Commit fbfba16f authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

adapt ci

parent 56998122
No related branches found
No related tags found
No related merge requests found
Pipeline #37028 passed
...@@ -41,7 +41,6 @@ check_labels: ...@@ -41,7 +41,6 @@ check_labels:
script: script:
- ./scripts/check_labels.sh $CI_MERGE_REQUEST_LABELS $CI_MERGE_REQUEST_MILESTONE - ./scripts/check_labels.sh $CI_MERGE_REQUEST_LABELS $CI_MERGE_REQUEST_MILESTONE
check_metadata: check_metadata:
extends: .env extends: .env
stage: tests stage: tests
...@@ -70,10 +69,10 @@ fmt_and_clippy: ...@@ -70,10 +69,10 @@ fmt_and_clippy:
- when: manual - when: manual
stage: quality stage: quality
script: script:
- cargo fmt -- --version - cargo fmt -- --version
- cargo fmt -- --check - cargo fmt -- --check
- cargo clippy -- -V - cargo clippy -- -V
- cargo clippy -Zgit=shallow-deps --features runtime-benchmarks --all --tests -- -D warnings - cargo clippy -Zgit=shallow-deps --features runtime-benchmarks --all --tests -- -D warnings
run_benchmarks: run_benchmarks:
extends: .env extends: .env
...@@ -259,7 +258,7 @@ create_g1_data: ...@@ -259,7 +258,7 @@ create_g1_data:
stage: build stage: build
rules: rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH =~ /^(release\/runtime-)[0-9].*/ - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH =~ /^(release\/runtime-)[0-9].*/
image: python:3.9.18 image: h30x/py-g1-migrator # this image already has plyvel python requirement and dependency
variables: variables:
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
LEVELDB_PATH: /dump/duniter_default/data/leveldb LEVELDB_PATH: /dump/duniter_default/data/leveldb
...@@ -271,8 +270,6 @@ create_g1_data: ...@@ -271,8 +270,6 @@ create_g1_data:
# - bin/duniter sync g1.cgeek.fr --store-txs --nointeractive --mdb 1.8.7 # - bin/duniter sync g1.cgeek.fr --store-txs --nointeractive --mdb 1.8.7
# - mkdir -p /tmp/backup-g1-duniter-1.8.7 # - mkdir -p /tmp/backup-g1-duniter-1.8.7
# - cp -R $HOME/.config/duniter/1.8.7/data /tmp/backup-g1-duniter-1.8.7 # - cp -R $HOME/.config/duniter/1.8.7/data /tmp/backup-g1-duniter-1.8.7
# - cp -R $HOME/.config/duniter/1.8.7/g1 /tmp/backup-g1-duniter-1.8.7
# - cp -R $HOME/.config/duniter/1.8.7/txs.db /tmp/backup-g1-duniter-1.8.7
# - tar -cvzf /tmp/backup-g1-duniter-1.8.7.tgz /tmp/backup-g1-duniter-1.8.7 # - tar -cvzf /tmp/backup-g1-duniter-1.8.7.tgz /tmp/backup-g1-duniter-1.8.7
# Then the file is uploaded to dl.cgeek.fr manually # Then the file is uploaded to dl.cgeek.fr manually
- curl https://dl.cgeek.fr/public/backup-g1-duniter-1.8.7.tgz -o g1-dump.tgz - curl https://dl.cgeek.fr/public/backup-g1-duniter-1.8.7.tgz -o g1-dump.tgz
...@@ -280,22 +277,20 @@ create_g1_data: ...@@ -280,22 +277,20 @@ create_g1_data:
- rm g1-dump.tgz - rm g1-dump.tgz
- mv tmp/backup-g1-duniter-1.8.7 duniter_default - mv tmp/backup-g1-duniter-1.8.7 duniter_default
# py-g1-migrator conversion # py-g1-migrator conversion
- git clone https://git.duniter.org/tools/py-g1-migrator.git -b import_identities_from_leveldb /py-g1-migrator - git clone https://git.duniter.org/tools/py-g1-migrator.git --depth 1 --branch hugo/docker /py-g1-migrator
- cd /py-g1-migrator - cd /py-g1-migrator
- rm -rf inputs/* # Export genesis file
- apt-get update - ./main.py # ./output/genesis.json
- apt-get install -y sqlite3 libleveldb-dev jq # Expore history files for squid
- pip install -r requirements.txt - ./squid-block.py # ./output/block_hist.json
# Export identities and wallets - ./squid-cert.py # ./output/cert_hist.json
- ./main.py - ./squid-tx.py # ./output/tx_hist.json
# Export transaction history
- sqlite3 /dump/duniter_default/txs.db --json "select time,comment,issuers,outputs from txs;" > inputs/transactions_history.json 2>> inputs/txs.err
- ./generate_transactions_history.py
# Merge in one file
- 'jq -s "{ identities: .[0].identities, wallets: .[0].wallets, initial_monetary_mass: .[0].initial_monetary_mass, current_block: .[0].current_block, transactions_history: .[1] }" output/gtest_genesis.json output/history.json > output/g1-data.json'
# Make the exported file available for next jobs # Make the exported file available for next jobs
- mkdir -p $CI_PROJECT_DIR/release/ - mkdir -p $CI_PROJECT_DIR/release/
- cp output/g1-data.json $CI_PROJECT_DIR/release/ - cp output/genesis.json $CI_PROJECT_DIR/release/
- cp output/block_hist.json $CI_PROJECT_DIR/release/
- cp output/cert_hist.json $CI_PROJECT_DIR/release/
- cp output/tx_hist.json $CI_PROJECT_DIR/release/
artifacts: artifacts:
expire_in: never expire_in: never
paths: paths:
......
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