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