-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
147 lines (136 loc) · 4.81 KB
/
.gitlab-ci.yml
File metadata and controls
147 lines (136 loc) · 4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
image: registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:0.32.1
include:
- project: "chromaway/core-infra/gitlab-automation"
ref: 1.3.6
file:
- templates/release.yml
stages:
- test
- build
- deploy
- prepare_release
- release
deploy:
image: registry.gitlab.com/chromaway/core-tools/chromia-images/maven-docker-java21:1.0.11@sha256:a985644b469b4d01dcbd726176d69e238d8c7012c077a429beb65f86905d0bd1
stage: deploy
rules:
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/
script:
- mvn
$MAVEN_CLI_OPTS
-s ci/gitlab-settings.xml
-Drevision=$CI_COMMIT_TAG
--file ci/pom.xml
deploy
deploy_library_chain:
extends: .deploy_library_chain
script:
- chr install --config config/chr.properties
- chr build
- ${CI_PROJECT_DIR}/ci/library_chain/deploy.sh -n begin_block --major 1 --minor 100 --library-description "Provides common functionality such as detecting configuration updates and scheduling jobs"
- ${CI_PROJECT_DIR}/ci/library_chain/deploy.sh -n transaction_prioritization --major 2 --minor 0 --library-description "Transaction prioritization"
test:
services:
- postgres
stage: test
script:
- CASC_YAML_MAX_ALIASES=1000 chr install --config config/chr.properties
- chr test --test-report
artifacts:
when: always
paths:
- logs/*.log
reports:
junit:
- "build/reports/*-tests.xml"
expire_in: 1 week
integration-test:
image: registry.gitlab.com/chromaway/core-tools/chromia-images/maven-docker-java21:1.0.11@sha256:a985644b469b4d01dcbd726176d69e238d8c7012c077a429beb65f86905d0bd1
services:
- postgres
stage: test
before_script:
- curl -fsSL https://apt.chromia.com/chromia.gpg | tee /usr/share/keyrings/chromia.gpg >/dev/null
- echo "deb [arch=amd64 signed-by=/usr/share/keyrings/chromia.gpg] https://apt.chromia.com stable main" | tee /etc/apt/sources.list.d/chromia.list
- apt-get update
- apt-get install -y --no-install-recommends chr=0.32.0 pmc=3.61.2
script:
- CASC_YAML_MAX_ALIASES=1000 chr install --config config/chr.properties
- chr build --hide-lib-warnings --settings chromia-it.yml
- rm -f node.log
- touch node.log
- chr node start --settings chromia-it.yml --name manager_it --hide-lib-warnings --managed-mode --wipe >> node.log 2>&1 &
- echo "Waiting for node to be ready..."
- timeout 60 grep -q "Node is initialized" <(tail -f node.log)
- echo "Node is ready, continuing with tests..."
- cd it
- pmc network initialize -cac ../build/cluster_anchoring_it.xml -sac ../build/system_anchoring_it.xml -ecc ../build/economy_chain_it.xml -tcc ../build/token_chain_it.xml --lookup-brid
- pmc economy add-tag --name tag --scu-price 1 --extra-storage-price 1
- pmc economy add-cluster --tag tag --name dappCluster --cluster-units 1 --voter-set SYSTEM_P --governor SYSTEM_P
- sleep 1
- while ! pmc cluster info --name dappCluster; do sleep 1; done
- pmc node update --cluster-units 2 --cluster dappCluster --pubkey 0324653EAC434488002CC06BBFB7F10FE18991E35F9FE4302DBEA6D2353DC0AB1C
- mvn $MAVEN_CLI_OPTS test
artifacts:
when: always
reports:
junit:
- "it/target/surefire-reports/*.xml"
paths:
- node.log
expire_in: 1 week
# Cache downloaded dependencies and plugins between builds.
cache:
paths:
- .m2/repository
key: maven-cache
compatibility:
stage: test
tags:
- private-network-0
allow_failure: true
script:
- CASC_YAML_MAX_ALIASES=1000 chr install --config config/chr.properties
- ci/compatibility/verify_in_container.sh
artifacts:
when: on_failure
paths:
- logs/*
build:
services:
- postgres
stage: build
script:
- CASC_YAML_MAX_ALIASES=1000 chr install --config config/chr.properties
- find . -maxdepth 1 -name 'chromia*.yml' -print0 | xargs -0n 1 chr build --hide-lib-warnings --settings
artifacts:
when: on_success
paths:
- build/*.xml
pages:
stage: deploy
rules:
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/
script:
- chr install --config config/chr.properties
- chr generate docs-site --target public
artifacts:
paths:
- public
gitlab-release:
extends: .gitlab-release-with-notes
script:
- echo "Running the release job."
- include_library_chain_releases
release:
name: 'Directory chain $CI_COMMIT_TAG'
description: release_notes.md
tag_name: '$CI_COMMIT_TAG'
variables:
GIT_DEPTH: 0
MAVEN_CLI_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -U"
POSTGRES_INITDB_ARGS: --lc-collate=C.UTF-8 --lc-ctype=C.UTF-8 --encoding=UTF-8
POSTGRES_DB: postchain
POSTGRES_USER: postchain
POSTGRES_PASSWORD: postchain
CHR_DB_URL: jdbc:postgresql://postgres/postchain