Gitlab has an internal PostgreSQL database. There is a client wrapper for psql
called gitlab-psql
that I connect to it with. This allows me to query job artifacts through the table ci_job_artifacts
. This table schema looks like this,
gitlabhq_production=# \d ci_job_artifacts
Table "public.ci_job_artifacts"
Column | Type | Collation | Nullable | Default
-------------------+--------------------------+-----------+----------+----------------------------------------------
project_id | integer | | not null |
file_type | integer | | not null |
size | bigint | | |
created_at | timestamp with time zone | | not null |
updated_at | timestamp with time zone | | not null |
expire_at | timestamp with time zone | | |
file | character varying | | |
file_store | integer | | | 1
file_sha256 | bytea | | |
file_format | smallint | | |
file_location | smallint | | |
id | bigint | | not null | nextval('ci_job_artifacts_id_seq'::regclass)
job_id | bigint | | not null |
locked | smallint | | | 2
original_filename | text | | |
partition_id | bigint | | not null | 100
accessibility | smallint | | not null | 0
How do I convert this to a path that I can use to find the artifact in GitLab Object Storage.