Add authorization for gerrit repositories
Change-Id: I851437d2b4b57e6be7d3971d8d73f349b299a990
Related-prod: PROD-24410
diff --git a/Dockerfile b/Dockerfile
index 50576d1..94afd9e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,7 +30,12 @@
&& echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes \
&& echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends \
&& apt-get update && apt-get upgrade -y \
- && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev iputils-ping patch
+ && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev iputils-ping patch openssh-server
+
+RUN mkdir -p /root/.ssh
+COPY bin/ssh/config /root/.ssh/
+COPY bin/ssh/mcp-jenkins.key /root/.ssh/
+RUN chmod 400 /root/.ssh/mcp-jenkins.key
#Due to upstream bug we should use fixed version of pip
RUN pip install -U 'pip==9.0.3'
@@ -39,50 +44,50 @@
RUN git clone https://github.com/openstack/requirements.git openstack_requirements && \
pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd ;
-RUN sed -i -e 's|tempest===17.2.0|git+https://gerrit.mcp.mirantis.net/packaging/sources/tempest@mcp/pike#egg=tempest|g' \
+RUN sed -i -e 's|tempest===17.2.0|git+ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest@mcp/pike#egg=tempest|g' \
/var/lib/openstack_requirements/upper-constraints.txt;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/tempest-horizon tempest-horizon-plugin ; \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin; \
pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; \
- pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/barbican-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin && \
pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/designate-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin && \
pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/heat-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin && \
pushd heat-tempest-plugin; git checkout $HEAT_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/ironic-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin && \
pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/manila-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin && \
pushd manila-tempest-plugin; git checkout $MANILA_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/telemetry-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin && \
pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/octavia-tempest-plugin && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/octavia-tempest-plugin && \
pushd octavia-tempest-plugin; git checkout $OCTAVIA_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
popd;
-RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/tempest && \
+RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest && \
pushd tempest; git checkout $TEMPEST_TAG; \
pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
pip install . ; popd;
@@ -102,6 +107,7 @@
RUN apt-get -y autoremove; apt-get -y clean;
RUN rm -rf /root/.cache
RUN rm -rf /var/lib/apt/lists/*
+RUN rm -rf /root/.ssh
RUN echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/build_timestamp
diff --git a/bin/ssh/config b/bin/ssh/config
new file mode 100644
index 0000000..6865806
--- /dev/null
+++ b/bin/ssh/config
@@ -0,0 +1,5 @@
+host gerrit.mcp.mirantis.com
+ HostName gerrit.mcp.mirantis.com
+ User mcp-jenkins
+ IdentityFile /root/.ssh/mcp-jenkins.key
+ StrictHostKeyChecking no
\ No newline at end of file
diff --git a/bin/ssh/mcp-jenkins.key b/bin/ssh/mcp-jenkins.key
new file mode 100644
index 0000000..67fcbfe
--- /dev/null
+++ b/bin/ssh/mcp-jenkins.key
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJKgIBAAKCAgEAsezSr2L3O4KToiQkrRuvWQ4JubgcZQfhIWGvvxrsbLHIXmaG
+vp2JEtWTSxYOpVSOHFWWFalzwB0mZ9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