-
Notifications
You must be signed in to change notification settings - Fork 290
/
Copy pathcouchdb.yaml
140 lines (117 loc) · 4.12 KB
/
couchdb.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
package:
name: couchdb
version: 3.3.3
epoch: 1
description: Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
copyright:
- license: Apache-2.0
dependencies:
environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- erlang-25
- erlang-25-dev
- icu-dev
- libtool
- mozjs91
- mozjs91-dev
- nodejs
- openssl-dev
- python3
pipeline:
- uses: git-checkout
with:
expected-commit: 40afbcfc7273f8dc47f8ef6d3394f377b9d0b629
repository: https://github.com/apache/couchdb
tag: ${{package.version}}
- uses: autoconf/configure
with:
opts: --spidermonkey-version=91
- runs: |
export CFLAGS="$CFLAGS -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare"
make release
- runs: |
mkdir -p ${{targets.destdir}}/usr/bin
mkdir -p ${{targets.destdir}}/usr/share/
mv rel/couchdb ${{targets.destdir}}/usr/share/couchdb
rm ${{targets.destdir}}/usr/share/couchdb/bin/couchdb.cmd
# symlink every file in /usr/share/couchdb/bin to /usr/bin
for file in ${{targets.destdir}}/usr/share/couchdb/bin/*; do
ln -s /usr/share/couchdb/bin/$(basename $file) ${{targets.destdir}}/usr/bin/$(basename $file)
done
- uses: strip
subpackages:
- name: couchdb-compat
pipeline:
- runs: |
# link /usr/share/couchdb to /opt/couchdb
mkdir -p ${{targets.subpkgdir}}/opt
ln -sf /usr/share/couchdb ${{targets.subpkgdir}}/opt/couchdb
- name: couchdb-doc
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/share/couchdb/
mv ${{targets.destdir}}/usr/share/couchdb/share ${{targets.subpkgdir}}/usr/share/couchdb/
test:
environment:
contents:
packages:
- curl
- jq
pipeline:
- name: CouchDB Start Server
runs: |
#!/bin/bash
mkdir /var/log/couchdb
# Configure CouchDB
# https://docs.couchdb.org/en/stable/setup/single-node.html#configure-couchdb
sed -i '/\[couchdb\]/a single_node = true' /usr/share/couchdb/etc/local.ini
# https://docs.couchdb.org/en/stable/setup/single-node.html#configure-admins
sed -i '/\[admins\]/,/^;/s/^;//' /usr/share/couchdb/etc/local.ini
# Start CouchDB in the background
couchdb > /var/log/couchdb/couchdb.log 2>&1 &
# Check for "cluster stable" in the logs
TIMEOUT=30 # Timeout in seconds
START_TIME=$(date +%s)
while true; do
# Check if the current time is past the timeout
CURRENT_TIME=$(date +%s)
if [ $((CURRENT_TIME - START_TIME)) -ge $TIMEOUT ]; then
echo "Timeout reached without finding 'cluster stable' in the logs."
exit 1
fi
# Check the logs for "cluster stable"
if grep -q "cluster stable" /var/log/couchdb/couchdb.log; then
echo "'Cluster stable' found in the logs."
break
fi
sleep 1 # Wait for 1 second before checking again
done
- name: CouchDB Test UIs
runs: |
#!/bin/bash
# Now test the UI
# Make a request to CouchDB and store the response
response=$(curl -s http://127.0.0.1:5984/)
# Use jq to parse the response and extract the value associated with the key "couchdb"
couchdb_value=$(echo $response | jq -r '.couchdb')
# Check if the extracted value is "Welcome"
if [ "$couchdb_value" == "Welcome" ]; then
echo "Test passed: 'couchdb':'Welcome' is present in the response."
else
echo "Test failed: 'couchdb':'Welcome' is not present in the response."
fi
update:
enabled: true
ignore-regex-patterns:
- nouveau
- fauxton
- post # looking at the release notes https://docs.couchdb.org/en/stable/whatsnew/index.html, it doesn't look like *.post releases are real releases, release monitoring ignores them too
github:
identifier: apache/couchdb
use-tag: true