Commit a5f8a215 authored by Andrea Manzi's avatar Andrea Manzi
Browse files

add docker packaging and gitlab-ci build

parent c3989edb
Pipeline #66899 passed with stage
in 4 minutes and 37 seconds
image: docker:latest
stages:
- build
- tag
variables:
CONTAINER_TEST_IMAGE: gitlab-registry.cern.ch/fts/fts-rest:latest
CONTAINER_RELEASE_IMAGE: gitlab-registry.cern.ch/fts/fts-rest:$CI_BUILD_REF_NAME
before_script:
- docker info
- docker login -p "${REGISTRY_PASSWD}" -u "${REGISTRY_USER}" gitlab-registry.cern.ch
after_script:
- docker logout gitlab-registry.cern.ch
job1:
build:
stage: build
only:
- develop
script:
- docker build -t gitlab-registry.cern.ch/fts/fts-rest packaging/docker
- docker push gitlab-registry.cern.ch/fts/fts-rest
- docker build --pull -t $CONTAINER_TEST_IMAGE packaging/docker
- docker push $CONTAINER_TEST_IMAGE
tags:
- docker
- docker
tag:
stage: tag
only:
- tags
script:
- docker build -t $CONTAINER_RELEASE_IMAGE --build-arg ftsrepo=http://fts-repo.web.cern.ch/fts-repo/fts3-rc-el7.repo --build-arg dmcrepo=http://dmc-repo.web.cern.ch/dmc-repo/dmc-rc-el7.repo packaging/docker
- docker push $CONTAINER_RELEASE_IMAGE
tags:
- docker
......@@ -9,22 +9,23 @@ RUN /usr/bin/rpm --import /tmp/RPM-GPG-KEY-cern \
&& rm /tmp/RPM-GPG-KEY-cern \
&& rm -rf /var/cache/yum
# Add EPEL repos
ADD http://mirror.switch.ch/ftp/mirror/epel/7/x86_64/e/epel-release-7-8.noarch.rpm /tmp/epel-release-7-8.noarch.rpm
RUN yum localinstall /tmp/epel-release-7-8.noarch.rpm -y \
#add EPEL repos
ADD http://mirror.switch.ch/ftp/mirror/epel/epel-release-latest-7.noarch.rpm /tmp/epel-release-7.noarch.rpm
RUN yum localinstall /tmp/epel-release-7.noarch.rpm -y \
&& /usr/bin/yum --enablerepo=*-testing clean all \
&& rm /tmp/epel-release-7-8.noarch.rpm \
&& rm /tmp/epel-release-7.noarch.rpm \
&& rm -rf /var/cache/yum
# add FTS repo
ADD http://grid-deployment.web.cern.ch/grid-deployment/dms/fts3/repos/fts3-continuous-el7.repo /etc/yum.repos.d/fts.repo
ARG ftsrepo=http://fts-repo.web.cern.ch/fts-repo/fts3-continuous-el7.repo
ADD $ftsrepo /etc/yum.repos.d/fts.repo
#add DMC repo
ARG dmcrepo=http://dmc-repo.web.cern.ch/dmc-repo/dmc-ci-el7.repo
ADD $dmcrepo /etc/yum.repos.d/dmc.repo
ADD http://grid-deployment.web.cern.ch/grid-deployment/dms/lcgutil/repos/dmc-ci-el7.repo /etc/yum.repos.d/dmc.repo
RUN /usr/bin/yum clean all
#install fts packages
RUN /usr/bin/yum install -y fts-rest-selinux fts-rest httpd MySQL-python
RUN /usr/bin/yum install -y voms-config-wlcg voms-config-vo-dteam
......@@ -36,5 +37,3 @@ RUN usermod -a -G fts3 apache
#expose ports
EXPOSE 8446
CMD /bin/bash
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment