Commit b1df0793 authored by Stavros Sachtouris's avatar Stavros Sachtouris

SNF_OCCI_BRANCH sets the repo branch to run in CI

When launching a new docker container, the user can now set the
repo branch to be deployed. Defaults to "develop".
parent 20ef7ed7
......@@ -16,6 +16,7 @@
# VERSION: 0.1
#
# docker run -ti --name occi-ci --net host -p 127.0.0.1:8080:8080 \
# -e SNF_OCCI_REPO="master" \
# -e AUTH_URL='https://accounts.okeanos.grnet.gr/identity/v2.0' \
# -e KEYSTONE_URL='https://okeanos-astavoms.hellasgrid.gr' -d \
# snf-occi-ci:latest
......@@ -23,13 +24,16 @@
FROM debian:jessie
MAINTAINER Stavros Sachtouris <saxtouri@grnet.gr>
ENV SNF_OCCI_BRANCH="develop"
RUN apt update && apt upgrade -y \
&& apt install -y python-pip python-dev git curl
RUN pip install Paste PasteScript pytz ooi
RUN git clone https://github.com/grnet/snf-occi.git
COPY config.py /snf-occi/soi/config.py
COPY run.sh /run.sh
RUN chmod u+x /run.sh
RUN cd /snf-occi && python setup.py clean install
EXPOSE 8080
CMD ["python", "/snf-occi/ci/run-server.py"]
CMD ["/run.sh"]
......@@ -5,12 +5,17 @@ Deploy with docker (recommended)
---
Use docker to build the snf-occi image and deploy the snf-occi in a container.
In the following example, we use the "master" branch, but you can change this
when running the container, but setting the SNF_OCCI_BRANCH variable to the
branch you want to test.
::
$ echo "Build the docker snf-occi-ci image"
$ docker build -t snf-occi-ci https://github.com/grnet/snf-occi.git#master:ci
$ docker build -t snf-occi-ci https://github.com/grnet/snf-occi.git#develop:ci
...
$ echo "Run the occi-ci container"
$ docker run -ti --name occi-ci --net host -p 127.0.0.1:8080:8080 \
-e SNF_OCCI_BRANCH="master" \
-e AUTH_URL='https://accounts.okeanos.grnet.gr/identity/v2.0' \
-e KEYSTONE_URL='https://okeanos-astavoms.hellasgrid.gr' -d \
snf-occi-ci
......
#!/bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ -z "$SNF_OCCI_BRANCH"]; then
export SNF_OCCI_BRANCH="develop"
fi
cd /snf-occi && git fetch --all && git checkout ${SNF_OCCI_BRANCH} && git pull \
&& python setup.py install
python /snf-occi/ci/run-server.py
......@@ -101,12 +101,16 @@ To test snf-occi, you can build and use a docker image, as described in the
::
$ docker build -t snf-occi-ci https://github.com/grnet/snf-occi#master:ci
$ docker build -t snf-occi-ci https://github.com/grnet/snf-occi.git#develop:ci
$ docker run -ti --name occi-ci --net host -p 127.0.0.1:8080:8080 \
-e SNF_OCCI_BRANCH="master" \
-e AUTH_URL='https://accounts.okeanos.grnet.gr/identity/v2.0' \
-e KEYSTONE_URL='https://okeanos-astavoms.hellasgrid.gr' -d \
snf-occi-ci
.. note: The default branch for CI testing is "develop", but you can test any
branch you want by setting the SNF_OCCI_BRANCH environment variable.
Testing
=======
......
......@@ -11,7 +11,7 @@ Alternatively, you can, of course, use the grnet repository to build the image:
::
$ docker build -t snf-occi-client:<version> https://github.com/grnet/snf-occi.git#master:soi/tests/functional
$ docker build -t snf-occi-client:<version> https://github.com/grnet/snf-occi.git#develop:soi/tests/functional
Run a new container
-------------------
......
#!/bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
CMD1="fetch-crl -p 20"
echo $CMD1
$(echo $CMD1)
......
#!/bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "Check vars ..."
......
#!/bin/bash
# Copyright (C) 2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "Check vars ..."
......
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