Commit e7fd3b7b authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added demo script and TAP_SCHEMA fixes

parent b74b81fa
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ build_db:
    refs:
      - master
    changes:
      - database
      - database/*
  script:
    - cd database
    - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"

README.md

0 → 100644
+28 −0
Original line number Diff line number Diff line
## Setup

    docker-compose pull
    docker-compose up -d

If you experience issues with the pull command use this setting in `/etc/docker/daemon.json`:

    {
        "insecure-registries" : [ "git.ia2.inaf.it:5050" ]
    }

## Demo

    ./call-tap.sh badtoken

Only free records (2 rows)

    ./call-tap.sh token1

Free records + records associated with group1 and group2 (6 rows)

    ./call-tap.sh token2

Free records + records associated with group2 (4 rows)

## Shutdown

    docker-compose down

call-tap.sh

0 → 100755
+15 −0
Original line number Diff line number Diff line
#!/bin/bash

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <token>"
    exit 1
fi

curl -s -XPOST \
        -H "Authorization: Bearer $1" \
        -F 'REQUEST=doQuery' \
        -F 'LANG=ADQL' \
        -F 'FORMAT=text/csv' \
        -F 'PHASE=RUN' \
        -F "QUERY=SELECT * from demo.private_rows;" \
        http://localhost:8080/tap/sync
+2 −0
Original line number Diff line number Diff line
update "TAP_SCHEMA".columns set arraysize = replace(arraysize, '*', '') where arraysize like '%*%';
update "TAP_SCHEMA".columns set arraysize = NULL where arraysize = '';