Skip to content
Snippets Groups Projects
Commit 65028b53 authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Merge branch 'exo3-virtualenv' into 'exo3'

Exo3 virtualenv

See merge request !7
parents d0ad3754 5dd4a49f
1 merge request!7Exo3 virtualenv
Pipeline #8887 passed with stages
in 3 minutes and 14 seconds
......@@ -4,41 +4,44 @@ stages:
- release
variables:
CONTAINER_TEST_IMAGE: boileaum/rosen:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE: boileaum/rosen:latest
before_script:
- echo $DOCKERHUB_PASSWD | docker login -u boileaum --password-stdin
CONTAINER_USERNAME: boileaum
CONTAINER_TEST_IMAGE: $CONTAINER_USERNAME/rosen:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE: $CONTAINER_USERNAME/rosen:latest
b:docker:
stage: build
tags:
- shell, docker
script:
- echo $DOCKERHUB_PASSWD | docker login -u $CONTAINER_USERNAME --password-stdin
- docker build --pull -t $CONTAINER_TEST_IMAGE -f ./docker/Dockerfile-rosen .
- docker push $CONTAINER_TEST_IMAGE
t:helloworld:
t:rosen-py36:
stage: test
image: $CONTAINER_TEST_IMAGE
tags:
- shell, docker
- tp-gitlab-ci, docker-exec
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'python test_helloworld.py'
- make clean && make
- pytest -v
t:rosen:
t:rosen-py27:
stage: test
image: $CONTAINER_TEST_IMAGE
tags:
- shell, docker
- tp-gitlab-ci, docker-exec
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'pytest -v'
- source /home/euler/py27/bin/activate
- make clean && make
- pytest -v
r:docker:
stage: release
tags:
- shell, docker
script:
- echo $DOCKERHUB_PASSWD | docker login -u $CONTAINER_USERNAME --password-stdin
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
......
FROM python:3
MAINTAINER Matthieu Boileau <matthieu.boileau@math.unistra.fr>
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update --fix-missing && \
apt-get install -y \
python-dev \
vim
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip install --no-cache-dir virtualenv
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
RUN useradd -m -s /bin/bash euler
ENV HOME /home/euler
RUN chown -R euler:euler /home/euler
USER euler
WORKDIR $HOME
CMD /bin/bash
RUN virtualenv --python=/usr/bin/python2.7 $HOME/py27
COPY requirements.txt /tmp/
RUN $HOME/py27/bin/pip install --no-cache-dir -r /tmp/requirements.txt
CMD /bin/bash
FROM boileaum/pythran:latest
MAINTAINER Matthieu Boileau <matthieu.boileau@math.unistra.fr>
ENV HOME /home/euler
ADD . $HOME/rosen
......
version: '2'
services:
env:
build:
context: ../
......
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
all: helloworld pythran
helloworld:
gcc helloworld.c -o helloworld.e
test: helloworld
python test_helloworld.py
all: pythran
pythran:
pythran rosenbrock.py -o rosenbrock_pythran.so
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test helloworld.c
"""
import os
assert os.popen('./helloworld.e', 'r').read() == "hello, world\n"
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