Home Quick start All builds News Donations
More
Log In
Light Theme Docs
Workers

SparrowCI Report - gh-melezhik-protocol-postgres | [image: melezhik/sparrow:alpine]

  • Summary
  • Pipeline YAML
  • Report
BuildID: 2479
Status: OK
Image: melezhik/sparrow:alpine
Worker status: OK
---
Date: 06.01.2023 @ 03:35
Time elapsed: 127 sec
---
SCM: https://github.com/melezhik/protocol-postgres.git
Git sha: 4da0fb8
Git comment: pass id
tasks:
  -
    name: int-test
    default: true
    language: Raku
    depends:
    -
      name: install
    -
      name: install-pg
    code: |
      use v6.d;
      use Protocol::Postgres;

      my $socket = await IO::Socket::Async.connect("localhost",5432);
      my $client = Protocol::Postgres::Client.new;
      $socket.Supply(:bin).act({ $client.incoming-data($^data) });
      $client.outbound-data.act({ $socket.write($^data) });

      await $client.startup("testuser", "testdb", "testpass");

      my $resultset = await $client.query('SELECT * FROM bar WHERE id = $1', 42);
      react {
        whenever $resultset.hash-rows -> (:$name, :$description, :$id) {
          say "$name is $description";
        }
      }
  -
    name: install
    language: Bash
    code: |
      set -e
      cd source/
      zef install . --/test
  -
    name: install-pg
    plugin: sparkyci-service-postgresql
    followup:
    -
      name: create-table
    config:
      db_name: testdb
      db_user: testuser
      db_pass: testpass
  -
    name: create-table
    language: Bash
    code: |
      set -e
      export PGPASSWORD=testpass
      psql -d testdb -U testuser -c "create table bar(name text, description text, id int)" -h localhost      
      psql -d testdb -U testuser -c "insert into bar(name, description, id) values('Raku','Programming Language', 42)" -h localhost      
      psql -d testdb -U testuser -c "select name, description, id from bar" -h localhost      
    
03:34:47 :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[task run: task.bash - tasks/install]
[dump code: task.bash]
[1] set -e
[2] cd source/
[3] zef install . --/test
[4] 
[task stdout]
03:34:53 :: ===> Searching for missing dependencies: Auth::SCRAM::Async
03:35:22 :: ===> Searching for missing dependencies: Crypt::Random
03:35:22 :: ===> Searching for missing dependencies: if
03:35:22 :: ===> Installing: if:ver<0.1.1>
03:35:22 :: ===> Installing: Crypt::Random:ver<0.4.1>
03:35:22 :: ===> Installing: Auth::SCRAM::Async:ver<0.0.1>:auth<cpan:LEONT>
03:35:22 :: ===> Installing: Protocol::Postgres:ver<0.0.3>:auth<cpan:LEONT>
[task stderr]
03:35:22 :: ===> Updating fez mirror: https://360.zef.pm/
03:35:22 :: ===> Updated fez mirror: https://360.zef.pm/
03:35:22 :: ===> Updating rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
03:35:22 :: ===> Updated rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
03:34:58 :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
03:35:00 :: [repository] - installing sparkyci-service-postgresql, version 0.000012
[task run: task.bash - install-pg]
[dump code: task.bash]
[1] set -e
[2] 
[3] db_user=$(config db_user)
[4] db_pass=$(config db_pass)
[5] db_name=$(config db_name)
[6] 
[7] set -x
[8] 
[9] 2>&1
[10] 
[11] echo "installing postgresql service on sparky"
[12] echo "======================================="
[13] 
[14] 
[15] sudo apk add postgresql
[16] 
[17] sudo mkdir -p /run/postgresql
[18] 
[19] sudo chown postgres:postgres /run/postgresql
[20] 
[21] sudo rm -rf /var/lib/postgresql/data
[22] 
[23] sudo mkdir -p /var/lib/postgresql/data
[24] 
[25] sudo chown postgres:postgres /var/lib/postgresql/data
[26] 
[27] sudo chmod 0700 /var/lib/postgresql/data
[28] 
[29] sudo -u postgres sh -c -l 'initdb -D /var/lib/postgresql/data'
[30] 
[31] sudo -u postgres sh -c -l 'postgres -D /var/lib/postgresql/data >/var/lib/postgresql/logfile 2>&1 &'
[32] 
[33] sleep 5
[34] 
[35] sudo -u postgres psql -c "create user $db_user with password '$db_pass'"
[36] sudo -u postgres sh -l -c "createdb $db_name"
[37] sudo -u postgres psql -c "grant all privileges on database $db_name to $db_user;"
[38] 
[39] export PGPASSWORD=$db_pass
[40] 
[41] psql -d $db_name -U $db_user -c "create table foo(a text)" -h localhost
[42] 
[43] 
[task stdout]
03:35:03 :: installing postgresql service on sparky
03:35:03 :: =======================================
03:35:03 :: fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
03:35:03 :: fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
03:35:04 :: fetch https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
03:35:04 :: (1/12) Installing postgresql-common (1.1-r2)
03:35:04 :: Executing postgresql-common-1.1-r2.pre-install
03:35:04 :: (2/12) Installing libpq (14.5-r0)
03:35:04 :: (3/12) Installing postgresql14-client (14.5-r0)
03:35:04 :: (4/12) Installing tzdata (2022f-r1)
03:35:05 :: (5/12) Installing icu-data-en (71.1-r2)
03:35:05 :: Executing icu-data-en-71.1-r2.post-install
03:35:05 :: (6/12) Installing icu-libs (71.1-r2)
03:35:05 :: (7/12) Installing gdbm (1.23-r0)
03:35:05 :: (8/12) Installing libsasl (2.1.28-r1)
03:35:05 :: (9/12) Installing libldap (2.6.3-r3)
03:35:05 :: (10/12) Installing xz-libs (5.2.5-r1)
03:35:05 :: (11/12) Installing libxml2 (2.9.14-r2)
03:35:05 :: (12/12) Installing postgresql14 (14.5-r0)
03:35:05 :: Executing postgresql14-14.5-r0.post-install
03:35:05 :: Executing busybox-1.35.0-r17.trigger
03:35:05 :: Executing postgresql-common-1.1-r2.trigger
03:35:05 :: OK: 739 MiB in 72 packages
03:35:06 :: The files belonging to this database system will be owned by user "postgres".
03:35:06 :: This user must also own the server process.
03:35:06 :: 
03:35:06 :: The database cluster will be initialized with locales
03:35:06 ::   COLLATE:  C
03:35:06 ::   CTYPE:    C.UTF-8
03:35:06 ::   MESSAGES: C
03:35:06 ::   MONETARY: C
03:35:06 ::   NUMERIC:  C
03:35:06 ::   TIME:     C
03:35:06 :: The default database encoding has accordingly been set to "UTF8".
03:35:06 :: The default text search configuration will be set to "english".
03:35:06 :: 
03:35:06 :: Data page checksums are disabled.
03:35:06 :: 
03:35:06 :: fixing permissions on existing directory /var/lib/postgresql/data ... ok
03:35:06 :: creating subdirectories ... ok
03:35:06 :: selecting dynamic shared memory implementation ... posix
03:35:06 :: selecting default max_connections ... 100
03:35:06 :: selecting default shared_buffers ... 128MB
03:35:06 :: selecting default time zone ... UTC
03:35:06 :: creating configuration files ... ok
03:35:06 :: running bootstrap script ... ok
03:35:07 :: performing post-bootstrap initialization ... ok
03:35:07 :: syncing data to disk ... ok
03:35:07 :: 
03:35:07 :: 
03:35:07 :: Success.
03:35:07 :: 
03:35:12 :: CREATE ROLE
03:35:13 :: GRANT
03:35:13 :: CREATE TABLE
[task stderr]
03:35:13 :: ++ echo 'installing postgresql service on sparky'
03:35:13 :: ++ echo =======================================
03:35:13 :: ++ sudo apk add postgresql
03:35:13 :: *
03:35:13 :: * If you need ICU with non-English locales and legacy charset support, install
03:35:13 :: * package icu-data-full.
03:35:13 :: *
03:35:13 :: *
03:35:13 :: * If you want to use JIT in PostgreSQL, install postgresql14-jit or
03:35:13 :: * postgresql-jit (if you didn't install specific major version of postgresql).
03:35:13 :: *
03:35:13 :: * Setting postgresql14 as the default version
03:35:13 :: ++ sudo mkdir -p /run/postgresql
03:35:13 :: ++ sudo chown postgres:postgres /run/postgresql
03:35:13 :: ++ sudo rm -rf /var/lib/postgresql/data
03:35:13 :: ++ sudo mkdir -p /var/lib/postgresql/data
03:35:13 :: ++ sudo chown postgres:postgres /var/lib/postgresql/data
03:35:13 :: ++ sudo chmod 0700 /var/lib/postgresql/data
03:35:13 :: ++ sudo -u postgres sh -c -l 'initdb -D /var/lib/postgresql/data'
03:35:13 :: initdb: warning: enabling "trust" authentication for local connections
03:35:13 :: You can change this by editing pg_hba.conf or using the option -A, or
03:35:13 :: --auth-local and --auth-host, the next time you run initdb.
03:35:13 :: ++ sudo -u postgres sh -c -l 'postgres -D /var/lib/postgresql/data >/var/lib/postgresql/logfile 2>&1 &'
03:35:13 :: ++ sleep 5
03:35:13 :: ++ sudo -u postgres psql -c 'create user testuser with password '\''testpass'\'''
03:35:13 :: ++ sudo -u postgres sh -l -c 'createdb testdb'
03:35:13 :: ++ sudo -u postgres psql -c 'grant all privileges on database testdb to testuser;'
03:35:13 :: ++ export PGPASSWORD=testpass
03:35:13 :: ++ PGPASSWORD=testpass
03:35:13 :: ++ psql -d testdb -U testuser -c 'create table foo(a text)' -h localhost
03:35:33 :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[task run: task.bash - tasks/create-table]
[dump code: task.bash]
[1] set -e
[2] export PGPASSWORD=testpass
[3] psql -d testdb -U testuser -c "create table bar(name text, description text, id int)" -h localhost      
[4] psql -d testdb -U testuser -c "insert into bar(name, description, id) values('Raku','Programming Language', 42)" -h localhost      
[5] psql -d testdb -U testuser -c "select name, description, id from bar" -h localhost      
[6] 
[task stdout]
03:35:36 :: CREATE TABLE
03:35:36 :: INSERT 0 1
03:35:36 ::  name |     description      | id 
03:35:36 :: ------+----------------------+----
03:35:36 ::  Raku | Programming Language | 42
03:35:36 :: (1 row)
03:35:36 :: 
03:34:23 :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
source directory does not yet exist, download source archive from storage
03:34:27 :: [repository] - installing pack-unpack, version 0.000001
[task run: task.bash - unpack source archive]
[dump code: task.bash]
[1] set -e
[2] 
[3] file=$(config file)
[4] dir=$(config dir)
[5] 
[6] echo "tar -xzf $file "
[7] 
[8] tar -xzf $file
[9] 
[10] if test $dir; then
[11]   ls -l $dir
[12] fi
[13] 
[14] 
[task stdout]
03:34:30 :: tar -xzf source.tar.gz 
[task run: task.raku - tasks/int-test]
[dump code: task.raku]
[1] use v6.d;
[2] use Protocol::Postgres;
[3] 
[4] my $socket = await IO::Socket::Async.connect("localhost",5432);
[5] my $client = Protocol::Postgres::Client.new;
[6] $socket.Supply(:bin).act({ $client.incoming-data($^data) });
[7] $client.outbound-data.act({ $socket.write($^data) });
[8] 
[9] await $client.startup("testuser", "testdb", "testpass");
[10] 
[11] my $resultset = await $client.query('SELECT * FROM bar WHERE id = $1', 42);
[12] react {
[13]   whenever $resultset.hash-rows -> (:$name, :$description, :$id) {
[14]     say "$name is $description";
[15]   }
[16] }
[17] 
[task stdout]
03:35:45 :: Raku is Programming Language