From 00f1665c60662357dc4262c4f5e9849400b39b1c Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 9 Jan 2023 20:52:09 +0800 Subject: [PATCH 1/5] init redis.io --- projects/redis.io/package.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 projects/redis.io/package.yml diff --git a/projects/redis.io/package.yml b/projects/redis.io/package.yml new file mode 100644 index 00000000..fd527814 --- /dev/null +++ b/projects/redis.io/package.yml @@ -0,0 +1,41 @@ +distributable: + url: https://download.redis.io/releases/redis-{{ version }}.tar.gz + strip-components: 1 + +versions: + github: redis/redis + + +provides: + - bin/redis-server + # - etc/redis.conf + +dependencies: + openssl.org: ^1 + +build: + dependencies: + gnu.org/make: '>=4.3' + freedesktop.org/pkg-config: '>=0.29' + script: + PREFIX={{prefix}} + BUILD_TLS=yes + make install + # todo: + # where to put redis.conf ? .tea/redis.io/etc? + + # %w[run db/redis log].each { |p| (var/p).mkpath } + + # # Fix up default conf file to match our paths + # inreplace "redis.conf" do |s| + # s.gsub! "/var/run/redis.pid", var/"run/redis.pid" + # s.gsub! "dir ./", "dir #{var}/db/redis/" + # s.sub!(/^bind .*$/, "bind 127.0.0.1 ::1") + # end + + # etc.install "redis.conf" + # etc.install "sentinel.conf" => "redis-sentinel.conf" +test: + script: | + redis-server --test-memory 2 + # %w[run db/redis log].each { |p| assert_predicate var/p, :exist?, "#{var/p} doesn't exist!" } \ No newline at end of file From eada7a7946d27055b465f28dd9a6abcf37d8325b Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 11 Jan 2023 18:51:42 +0800 Subject: [PATCH 2/5] make redis install work --- projects/redis.io/package.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/projects/redis.io/package.yml b/projects/redis.io/package.yml index fd527814..79a14003 100644 --- a/projects/redis.io/package.yml +++ b/projects/redis.io/package.yml @@ -8,7 +8,8 @@ versions: provides: - bin/redis-server - # - etc/redis.conf + - bin/redis-cli + - bin/redis-benchmark dependencies: openssl.org: ^1 @@ -17,25 +18,14 @@ build: dependencies: gnu.org/make: '>=4.3' freedesktop.org/pkg-config: '>=0.29' + tea.xyz/gx/cc: c99 script: PREFIX={{prefix}} BUILD_TLS=yes make install - # todo: - # where to put redis.conf ? .tea/redis.io/etc? - - # %w[run db/redis log].each { |p| (var/p).mkpath } - - # # Fix up default conf file to match our paths - # inreplace "redis.conf" do |s| - # s.gsub! "/var/run/redis.pid", var/"run/redis.pid" - # s.gsub! "dir ./", "dir #{var}/db/redis/" - # s.sub!(/^bind .*$/, "bind 127.0.0.1 ::1") - # end - - # etc.install "redis.conf" - # etc.install "sentinel.conf" => "redis-sentinel.conf" + # TODO: configure default redis.conf if necessary test: script: | redis-server --test-memory 2 - # %w[run db/redis log].each { |p| assert_predicate var/p, :exist?, "#{var/p} doesn't exist!" } \ No newline at end of file + redis-cli --version + redis-benchmark --version \ No newline at end of file From f64ce6ef8bc7b79ad155b3b0d3d47a11ff0ef941 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 13 Jan 2023 07:55:19 +0800 Subject: [PATCH 3/5] redis.io: improve config and testing --- projects/redis.io/package.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/projects/redis.io/package.yml b/projects/redis.io/package.yml index 79a14003..abb7a202 100644 --- a/projects/redis.io/package.yml +++ b/projects/redis.io/package.yml @@ -16,16 +16,32 @@ dependencies: build: dependencies: - gnu.org/make: '>=4.3' + # gnu.org/make: '>=4.3' + tea.xyz/gx/make: '*' freedesktop.org/pkg-config: '>=0.29' tea.xyz/gx/cc: c99 script: - PREFIX={{prefix}} - BUILD_TLS=yes make install # TODO: configure default redis.conf if necessary + env: + PREFIX: ${{prefix}} + BUILD_TLS: yes test: script: | redis-server --test-memory 2 redis-cli --version - redis-benchmark --version \ No newline at end of file + redis-benchmark --version + + redis-server --daemonize yes + redis-cli --raw SET key123 value123 + redis_value=$(redis-cli --raw GET key123) + echo $redis_value + + redis-cli shutdown + + if [ $redis_value = "value123" ]; then + echo "redis works!" + else + echo "redis install doesnt work!" + set -e + fi From 960a368986e3756274777d5c7b11f25668ce2509 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 13 Jan 2023 08:04:52 +0800 Subject: [PATCH 4/5] add core size --- projects/redis.io/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/redis.io/package.yml b/projects/redis.io/package.yml index abb7a202..65c27127 100644 --- a/projects/redis.io/package.yml +++ b/projects/redis.io/package.yml @@ -15,8 +15,8 @@ dependencies: openssl.org: ^1 build: + cores: 2 dependencies: - # gnu.org/make: '>=4.3' tea.xyz/gx/make: '*' freedesktop.org/pkg-config: '>=0.29' tea.xyz/gx/cc: c99 From 3064b0d7d72ad26f8280989b1f37663fcb169be9 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 13 Jan 2023 08:08:57 +0800 Subject: [PATCH 5/5] redis.io: simplify test --- projects/redis.io/package.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/projects/redis.io/package.yml b/projects/redis.io/package.yml index 65c27127..5b47b7fd 100644 --- a/projects/redis.io/package.yml +++ b/projects/redis.io/package.yml @@ -34,14 +34,7 @@ test: redis-server --daemonize yes redis-cli --raw SET key123 value123 - redis_value=$(redis-cli --raw GET key123) - echo $redis_value + + test "$(redis-cli --raw GET key123)" = "value123" redis-cli shutdown - - if [ $redis_value = "value123" ]; then - echo "redis works!" - else - echo "redis install doesnt work!" - set -e - fi