Install utility scripts for running jeepyb commands

jeepyb is installed in the gerrit image because of hook scripts.
To run manage-projects and track-upstream, make wrapper scripts
in /usr/local that runs the commands from in the container image
bind-mounting the appropriate dirs and files into the container.

Change-Id: I7ef1f00e69d4c310d69d83c80ca210e8f340878d
This commit is contained in:
Monty Taylor 2020-03-21 11:12:44 -05:00
parent 906e6a72a1
commit e6d98f0181
6 changed files with 73 additions and 0 deletions

View File

@ -11,3 +11,4 @@ gerrit_storyboard_url: https://storyboard-dev.openstack.org
gerrit_vhost_name: review-dev.opendev.org
gerrit_redirect_vhost: review-dev.openstack.org
gerrit_project_config_base: /opt/project-config/dev
gerrit_project_creator_user: openstack-dev-project-creator

View File

@ -18,3 +18,4 @@ gerrit_container_volumes:
- /home/gerrit2/.ssh:/var/gerrit/.ssh
gerrit_database_type: MYSQL
gerrit_project_config_base: /opt/project-config
gerrit_project_creator_user: openstack-project-creator

View File

@ -233,6 +233,17 @@
- etc/GerritSite.css
- etc/GerritSiteHeader.html
- name: Write jeepyb utility scripts
template:
src: "{{ item }}.j2"
dest: "/usr/local/bin/{{ item }}"
owner: root
group: root
mode: 0755
loop:
- manage-projects
- track-upstream
- name: Install apache2
apt:
name:

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
exec docker run -it --rm -u root \
-v{{ gerrit_project_config_base }}:/opt/project-config \
-v{{ gerrit_project_config_base }}/gerrit/projects.yaml:/home/gerrit2/projects.yaml \
-v/opt/lib/git:/opt/lib/git \
-v/opt/lib/jeepyb:/opt/lib/jeepyb \
-v/home/gerrit2/review_site/etc/ssh_project_rsa_key:/home/gerrit2/review_site/etc/ssh_project_rsa_key \
-v/home/gerrit2/projects.ini:/home/gerrit2/projects.ini \
-v/var/log:/var/log \
{{ gerrit_container_image }} manage-projects -v -l /var/log/manage_projects.log

View File

@ -0,0 +1,10 @@
[projects]
homepage=https://opendev.org
acl-dir=/opt/project-config/gerrit/acls
local-git-dir=/opt/lib/git
jeepyb-cache-dir=/opt/lib/jeepyb
gerrit-host={{ gerrit_vhost_name }}
gerrit-user={{ gerrit_project_creator_user }}
gerrit-committer=OpenDev Project Creator <openstack-infra@lists.openstack.org>
gerrit-key=/home/gerrit2/review_site/etc/ssh_project_rsa_key
has-github=false

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
exec docker run -it --rm -u root \
-v{{ gerrit_project_config_base }}:/opt/project-config \
-v{{ gerrit_project_config_base }}/gerrit/projects.yaml:/home/gerrit2/projects.yaml \
-v/opt/lib/git:/opt/lib/git \
-v/opt/lib/jeepyb:/opt/lib/jeepyb \
-v/home/gerrit2/review_site/etc/ssh_project_rsa_key:/home/gerrit2/review_site/etc/ssh_project_rsa_key \
-v/home/gerrit2/projects.ini:/home/gerrit2/projects.ini \
-v/var/log:/var/log \
{{ gerrit_container_image }} track-upstream -v -l /var/log/track_upstream.log