なにがしたいの
- Dockerで動かしてるGitLabのsnippetの一覧が欲しい
- Where are the snippets stored? (#21946) · Issues · GitLab.org / GitLab Community Edition · GitLab
「snippetsどこにあるの?」「DBのsnippets
テーブルにあるよ!」 - SQLを叩いてサッと取得したい
どうするのか
# host docker exec -it <name> /bin/bash # docker (root) su - gitlab-psql # docker(gitlab-psql) psql -h /var/opt/gitlab/postgresql/ gitlabhq_production # postgres \d snippets SELECT users.name, snippets.id, snippets.title FROM snippets LEFT JOIN users ON users.id = snippets.author_id ;
gitlabhq_production-# ; name | id | title ----------+----+---------------------------------------------------------------------------------------------- hogehoge | 1 | vimrc hogehoge | 2 | vagrantfile hogehoge | 3 | vagrantfile hogehoge | 4 | zshrc
おわり