-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathcassandra-5.0.yaml
170 lines (150 loc) · 5.02 KB
/
cassandra-5.0.yaml
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package:
name: cassandra-5.0
version: "5.0.3"
epoch: 3
description: Open Source NoSQL Database
copyright:
- license: Apache-2.0
dependencies:
runtime:
- curl
- jemalloc
- python-${{vars.py-version}} # needed for cqlsh
provides:
- cassandra=${{package.full-version}}
var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+$
replace: "$1"
to: major-minor-version
vars:
py-version: 3.11
java-version: 11
environment:
contents:
packages:
- ant
- bash
- build-base
- busybox
- ca-certificates-bundle
- openjdk-${{vars.java-version}}-default-jdk
- py${{vars.py-version}}-build
- py${{vars.py-version}}-cython-bin
- py${{vars.py-version}}-pip
- py${{vars.py-version}}-setuptools
- python-${{vars.py-version}}-dev
environment:
JAVA_HOME: /usr/lib/jvm/java-${{vars.java-version}}-openjdk
CASSANDRA_USE_JDK11: true
pipeline:
- uses: git-checkout
with:
repository: https://github.com/apache/cassandra
expected-commit: b0226c8ea122c3e5ea8680efb0744d33924fd732
tag: cassandra-${{package.version}}
- uses: maven/pombump
with:
patch-file: pombump-deps.yaml
pom: ./.build/parent-pom-template.xml
- runs: |
ant -Drat.skip=true artifacts -Dversion=${{package.version}}
# Install cassandra from the tarball in build/dist into the destdir in /usr/share/java/cassandra
mkdir -p "${{targets.destdir}}"/usr/share/java/cassandra
tar --strip-components 1 -C "${{targets.destdir}}"/usr/share/java/cassandra -xzf build/apache-cassandra-${{package.version}}-bin.tar.gz
# Symlink everything in the cassandra bin directory into /usr/bin
mkdir -p "${{targets.destdir}}"/usr/bin/
for f in /home/build/build/dist/bin/*; do
filename=$(basename "$f")
ln -sf /usr/share/java/cassandra/bin/"$filename" "${{targets.destdir}}"/usr/bin/"$filename"
done
mkdir -p ${{targets.destdir}}/var/lib/cassandra
mkdir -p ${{targets.destdir}}/var/log/cassandra
ln -sT /var/lib/cassandra/ "${{targets.destdir}}"/usr/share/java/cassandra/data
ln -sT /var/log/cassandra/ "${{targets.destdir}}"/usr/share/java/cassandra/logs
subpackages:
- name: ${{package.name}}-compat
dependencies:
provides:
- cassandra-compat=${{package.full-version}}
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/etc
ln -sf /opt/cassandra/conf ${{targets.subpkgdir}}/etc/cassandra
mkdir -p ${{targets.subpkgdir}}/opt
ln -sf /usr/share/java/cassandra ${{targets.subpkgdir}}/opt/cassandra
- name: cqlsh-${{vars.major-minor-version}}
dependencies:
runtime:
- py${{vars.py-version}}-cassandra-driver
- py${{vars.py-version}}-wcwidth
provides:
- cqlsh=${{package.full-version}}
pipeline:
- name: "Install python module"
working-directory: pylib
uses: py/pip-build-install
with:
python: python${{vars.py-version}}
- name: "Install cqlsh executable"
runs: |
mkdir -p ${{targets.contextdir}}/usr/bin
cp ./bin/cqlsh.py ${{targets.contextdir}}/usr/bin/cqlsh
python=python${{vars.py-version}}
sed -i "1s,.*,#!/usr/bin/$python,g" ${{targets.contextdir}}/usr/bin/cqlsh
head -n 1 ${{targets.contextdir}}/usr/bin/cqlsh
test:
pipeline:
- runs: |
cqlsh --version
update:
enabled: true
github:
identifier: apache/cassandra
use-tag: true
tag-filter-prefix: cassandra-5.0
strip-prefix: cassandra-
test:
environment:
contents:
packages:
- bash
- coreutils
- procps
- shadow
- ${{package.name}}-compat
- openjdk-${{vars.java-version}}-default-jvm
environment:
LANG: en_US.UTF-8
CASSANDRA_HOME: /opt/cassandra
CASSANDRA_CONF: /opt/cassandra/conf
CASSANDRA_LOGS_DIR: /opt/cassandra/logs
PATH: /usr/sbin:/sbin:/usr/bin:/bin:/opt/cassandra/bin/
pipeline:
- runs: |
cqlsh --help
cqlsh.py --version
cqlsh.py --help
stop-server -h
- name: "Test Cassandra server startup"
uses: test/daemon-check-output
with:
start: |
cassandra -R -f
timeout: 120
expected_output: |
Startup complete
post: |
# Basic connectivity test
nodetool status | grep -q "UN"
# Run CQL operations
cqlsh -e "CREATE KEYSPACE IF NOT EXISTS test_ks
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"
cqlsh -e "CREATE TABLE IF NOT EXISTS test_ks.test_table
(id uuid PRIMARY KEY, value text);"
cqlsh -e "INSERT INTO test_ks.test_table (id, value)
VALUES (uuid(), 'test_value');"
# Verify data
cqlsh -e "SELECT value FROM test_ks.test_table;" | grep -q "test_value"
# Check node tools
nodetool info | grep -q "Native Transport active"