This repository was archived by the owner on Jun 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +50
-32
lines changed
Expand file tree Collapse file tree 5 files changed +50
-32
lines changed Original file line number Diff line number Diff line change 33. ./bin/tests.sh
44
55cd build
6- docker build -t pythonregex .
6+ docker build -t pythonregex:101 .
Original file line number Diff line number Diff line change 1- #! /usr/ bin/env bash
1+ #! /bin/sh
22
3+ USE_DOCKER=0
34# Install Python Virtual env only on non docker machine
45if [ " $1 " != " --docker" ];
56then
67 # Install virtual env
78 printf " Installing python 3 virtual environment\n"
89 python3 -m venv env > /dev/null 2>&1
910 source env/bin/activate
11+ else
12+ USE_DOCKER=1
1013fi
1114
1215printf " Update pip\n"
3639 SECRET=` mongo pythonregex --quiet --eval " db.configuration.find({key: 'secret_key'})[0].value" `
3740fi
3841
42+ # Use env instead of user entry
43+
3944# Register admin user
40- printf " \nEnter the admin user name: "
41- ADMIN_USER=
42- while [[ ${ADMIN_USER} = " " ]];
43- do
44- read ADMIN_USER
45- done
45+ if [ " ${USE_DOCKER} " = " 0" ];
46+ then
47+ printf " \nEnter the admin user name: "
48+ ADMIN_USER=
49+ while [[ ${ADMIN_USER} = " " ]];
50+ do
51+ read ADMIN_USER
52+ done
4653
47- ADMIN_EMAIL=
48- printf " Enter your email address (for normal connection): "
49- while [[ ${ADMIN_EMAIL} = " " ]];
50- do
51- read ADMIN_EMAIL
52- done
54+ ADMIN_EMAIL=
55+ printf " Enter your email address (for normal connection): "
56+ while [[ ${ADMIN_EMAIL} = " " ]];
57+ do
58+ read ADMIN_EMAIL
59+ done
60+
61+ printf " Enter the admin password: "
62+ ADMIN_PASSWORD=
63+ while [[ ${ADMIN_PASSWORD} = " " ]];
64+ do
65+ read ADMIN_PASSWORD
66+ done
67+ else
68+ echo " Use docker"
69+ fi
5370
54- printf " Enter the admin password: "
55- ADMIN_PASSWORD=
56- while [[ ${ADMIN_PASSWORD} = " " ]];
57- do
58- read ADMIN_PASSWORD
59- done
6071PASSWORD=` python -c " import hashlib;print(hashlib.sha256('${SECRET} '.encode() + '${ADMIN_PASSWORD} '.encode()).hexdigest())" `
6172
6273NOW=` date +%s`
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ source env/bin/activate
1313python tests/test.py
1414
1515# Quit with the same error code
16- if [ $? ! 0 ];
16+ if [ $? != 0 ];
1717then
1818 exit $?
1919fi
Original file line number Diff line number Diff line change 1- FROM alpine
1+ FROM ubuntu
22
3- MAINTAINER Regis FLORET
3+ MAINTAINER Regis FLORET <regisfloret@gmail.com>
44
55LABEL com.python-regex.version="1.0.1"
66
7- RUN apk add --no-cache python3 && \
8- python3 -m ensurepip && \
9- apk add --no-cache git&& \
10- rm -r /usr/lib/python*/ensurepip && \
7+ RUN apt-get update && \
8+ apt-get upgrade -y && \
9+ apt-get install apt-utils python3 python3-pip git mongodb -y && \
10+ \
1111 pip3 install --upgrade pip setuptools && \
1212 rm -r /root/.cache && \
13- git clone https://github.com/regisf/pythonregex.git && \
13+ \
14+ service mongodb start && \
15+ \
16+ git clone -b add-docker https://github.com/regisf/pythonregex.git && \
1417 cd pythonregex && \
15- bin/install.sh --docker
18+ bin/install.sh --docker && \
19+ \
20+ apt-get autoremove -y && \
21+ apt-get clean
1622
1723EXPOSE 8888
1824WORKDIR pythonregex
Original file line number Diff line number Diff line change 55 python tests/test.py
66"""
77
8- __author__ = 'Régis FLORET'
9-
108import unittest
119
1210
13- class TestEmailModel (unittest ):
11+ __author__ = 'Régis FLORET'
12+
13+
14+ class TestEmailModel (unittest .TestCase ):
1415 def test_get_template (self ):
1516 self .assertTrue (True )
1617
You can’t perform that action at this time.
0 commit comments