Skip to content

Commit 6870676

Browse files
Adding GraphQL
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent e112887 commit 6870676

13 files changed

Lines changed: 222 additions & 0 deletions

graphql/add_metric.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# USE_FLAGS=1 (will check devstats runnign flag and abort when set, then it will clear provisioned flag for the time of adding new metric and then set it)
3+
if ( [ -z "$PG_PASS" ] || [ -z "$PG_HOST" ] || [ -z "$PG_PORT" ] )
4+
then
5+
echo "$0: you need to set PG_PASS, PG_HOST and PG_PORT to run this script"
6+
exit 1
7+
fi
8+
9+
export GHA2DB_PROJECTS_YAML="graphql/projects.yaml"
10+
export LIST_FN_PREFIX="graphql/all_"
11+
12+
. ./devel/all_projs.sh || exit 2
13+
for proj in $all
14+
do
15+
db=$proj
16+
if [ ! -z "$USE_FLAGS" ]
17+
then
18+
./devel/check_flag.sh "$db" devstats_running 0 || exit 3
19+
./devel/clear_flag.sh "$db" provisioned || exit 4
20+
fi
21+
GHA2DB_PROJECT=$proj PG_DB=$db ./devel/add_single_metric.sh || exit 5
22+
if [ ! -z "$USE_FLAGS" ]
23+
then
24+
./devel/set_flag.sh "$db" provisioned || exit 6
25+
fi
26+
done
27+
28+
echo 'OK'

graphql/affs.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
if ( [ -z "$PG_PASS" ] || [ -z "$PG_HOST" ] || [ -z "$PG_PORT" ] )
3+
then
4+
echo "$0: you need to set PG_PASS, PG_HOST and PG_PORT to run this script"
5+
exit 1
6+
fi
7+
8+
export GHA2DB_PROJECTS_YAML="graphql/projects.yaml"
9+
export LIST_FN_PREFIX="graphql/all_"
10+
11+
. ./devel/all_projs.sh || exit 2
12+
for proj in $all
13+
do
14+
db=$proj
15+
./devel/check_flag.sh "$db" devstats_running 0 || exit 3
16+
./devel/clear_flag.sh "$db" provisioned || exit 4
17+
GHA2DB_PROJECT=$proj PG_DB=$db ./shared/all_affs.sh || exit 5
18+
./devel/set_flag.sh "$db" provisioned || exit 6
19+
done
20+
21+
echo 'All affiliations updated'

graphql/all_prod_dbs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graphql graphqljs

graphql/all_prod_projects.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graphql graphqljs

graphql/all_test_dbs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graphql graphqljs

graphql/all_test_projects.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graphql graphqljs
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if ( [ -z "$PG_PASS" ] || [ -z "$PG_HOST" ] || [ -z "$PG_PORT" ] || [ -z "$PROJDB" ] )
3+
then
4+
echo "$0: you need to set PROJDB, PG_PASS, PG_HOST and PG_PORT to run this script"
5+
exit 1
6+
fi
7+
./devel/clear_flag.sh "$PROJDB" devstats_running || exit 1

graphql/deploy_all.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
# ARTWORK
3+
# GET=1 (attempt to fetch Postgres database from the test server)
4+
# INIT=1 (needs PG_PASS_RO, PG_PASS_TEAM, initialize from no postgres database state, creates postgres logs database and users)
5+
# ONLYINIT=1 (only run init_database.sh and then exit success)
6+
# SKIPVARS=1 (if set it will skip final Postgres vars regeneration)
7+
set -o pipefail
8+
exec > >(tee run.log)
9+
exec 2> >(tee errors.txt)
10+
if ( [ ! -z "$INIT" ] && ( [ -z "$PG_PASS_RO" ] || [ -z "$PG_PASS_TEAM" ] ) )
11+
then
12+
echo "$0: You need to set PG_PASS_RO, PG_PASS_TEAM when using INIT"
13+
exit 1
14+
fi
15+
16+
if ( [ -z "$PG_PASS" ] || [ -z "$PG_HOST" ] || [ -z "$PG_PORT" ] )
17+
then
18+
echo "$0: you need to set PG_PASS, PG_HOST and PG_PORT to run this script"
19+
exit 2
20+
fi
21+
22+
if [ -z "$ONLYINIT" ]
23+
then
24+
if ( [ -z "$PROJ" ] || [ -z "$PROJDB" ] || [ -z "$PROJREPO" ] )
25+
then
26+
echo "$0: You need to set PROJ, PROJDB, PROJREPO environment variables to run this script"
27+
exit 3
28+
fi
29+
fi
30+
31+
# export PG_ADMIN_USER=sa
32+
export GHA2DB_PROJECTS_YAML="graphql/projects.yaml"
33+
export LIST_FN_PREFIX="graphql/all_"
34+
35+
if [ ! -z "$ONLY" ]
36+
then
37+
export ONLY
38+
fi
39+
40+
if [ ! -z "$INIT" ]
41+
then
42+
./devel/init_database.sh || exit 4
43+
if [ ! -z "$ONLYINIT" ]
44+
then
45+
echo "Only init mode, exiting"
46+
exit 0
47+
fi
48+
fi
49+
50+
ORGNAME="-" PORT="-" ICON="-" GRAFSUFF="-" GA="-" SKIPGRAFANA=1 ./devel/deploy_proj.sh || exit 5
51+
52+
if [ -z "$SKIPVARS" ]
53+
then
54+
GHA2DB_EXCLUDE_VARS="projects_health_partial_html" ./devel/vars_all.sh || exit 6
55+
fi
56+
57+
echo "<<< start: errors.txt >>>"
58+
cat errors.txt 2>/dev/null
59+
echo "<<< end: errors.txt >>>"
60+
61+
./devel/set_flag.sh "$PROJDB" provisioned || exit 7
62+
63+
echo "$0: All deployments finished"

graphql/projects.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
projects:
3+
graphql:
4+
order: 1
5+
name: GraphQL
6+
status: "-"
7+
command_line: ['graphql']
8+
start_date: 2015-12-07T18:00:00Z
9+
join_date: 2015-12-07T18:00:00Z
10+
psql_db: graphql
11+
main_repo: 'graphql/graphql-js'
12+
annotation_regexp: '^v\d+\.\d+\.\d+$'
13+
files_skip_pattern: ''
14+
graphqljs:
15+
order: 2
16+
name: GraphQL JavaScript
17+
status: "-"
18+
command_line: ['graphql/graphql-js']
19+
start_date: 2014-01-06T00:00:00Z
20+
join_date: 2016-05-09T00:00:00Z
21+
psql_db: graphqljs
22+
main_repo: 'graphql/graphql-js'
23+
annotation_regexp: '^v\d+\.\d+\.\d+$'
24+
files_skip_pattern: ''

graphql/reinit.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
if ( [ -z "$PG_PASS" ] || [ -z "$PG_HOST" ] || [ -z "$PG_PORT" ] )
3+
then
4+
echo "$0: you need to set PG_PASS, PG_HOST and PG_PORT to run this script"
5+
exit 1
6+
fi
7+
8+
export GHA2DB_PROJECTS_YAML="graphql/projects.yaml"
9+
export LIST_FN_PREFIX="graphql/all_"
10+
11+
. ./devel/all_projs.sh || exit 2
12+
for proj in $all
13+
do
14+
db=$proj
15+
16+
./devel/check_flag.sh "$db" devstats_running 0 || exit 3
17+
./devel/clear_flag.sh "$db" provisioned || exit 4
18+
19+
if [ -f "./$proj/reinit.sh" ]
20+
then
21+
./$proj/reinit.sh || exit 5
22+
else
23+
GHA2DB_PROJECT=$proj PG_DB=$db ./shared/reinit.sh || exit 6
24+
fi
25+
26+
./devel/set_flag.sh "$db" provisioned || exit 7
27+
done
28+
29+
echo 'TS data regenerated'

0 commit comments

Comments
 (0)