Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
go
Commits
6b94926a
Unverified
Commit
6b94926a
authored
Jan 14, 2017
by
David Haynes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final cleanup of gitlab-ci.yml for optimal testing
- testing support for 2.7 and 3.6
parent
6b50dc69
Pipeline
#759
passed with stages
in 2 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
44 deletions
+24
-44
.gitlab-ci.yml
.gitlab-ci.yml
+24
-44
No files found.
.gitlab-ci.yml
View file @
6b94926a
...
...
@@ -2,63 +2,43 @@ services:
-
mysql:latest
types
:
-
test-2.7
-
test-3.6
-
test-
python-
2.7
-
test-
python-
3.6
variables
:
MYSQL_DATABASE
:
go
MYSQL_ROOT_PASSWORD
:
root
before_script
:
-
apt-get update -qy
-
apt-get install -y libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libjpeg-dev libsasl2-dev
-
pip install -r requirements.txt
-
cd go/
-
cp settings/settings.py.template settings/settings.py
-
cp settings/secret.py.template settings/secret.py
-
export SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9" | fold -w 60 | head -n1 2>/dev/null)
-
export DJANGO_DEBUG="True"
-
sed -i settings/secret.py -e 's/DB_NAME.*/DB_NAME = \"go\"/'
-
sed -i settings/secret.py -e 's/DB_USER.*/DB_USER = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_PASSWORD.*/DB_PASSWORD = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_HOST.*/DB_HOST = \"mysql\"/'
-
sed -i settings/secret.py -e 's/SECRET_KEY.*/SECRET_KEY = \"${SECRET_KEY}\"/'
-
python manage.py makemigrations
-
python manage.py makemigrations go
-
python manage.py migrate
-
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('root', 'root@srct.gmu.edu', 'root') " | python manage.py shell
-
pip install tblib
Go-py2.7
:
image
:
library/python:2.7
type
:
test-2.7
before_script
:
-
python --version
-
apt-get update -qy
-
apt-get install -y libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libjpeg-dev libsasl2-dev
-
pip install -r requirements.txt
-
cd go/
-
cp settings/settings.py.template settings/settings.py
-
cp settings/secret.py.template settings/secret.py
-
export SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9" | fold -w 60 | head -n1 2>/dev/null)
-
export DJANGO_DEBUG="True"
-
sed -i settings/secret.py -e 's/DB_NAME.*/DB_NAME = \"go\"/'
-
sed -i settings/secret.py -e 's/DB_USER.*/DB_USER = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_PASSWORD.*/DB_PASSWORD = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_HOST.*/DB_HOST = \"mysql\"/'
-
sed -i settings/secret.py -e 's/SECRET_KEY.*/SECRET_KEY = \"${SECRET_KEY}\"/'
-
python manage.py makemigrations
-
python manage.py makemigrations go
-
python manage.py migrate
-
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('root', 'root@srct.gmu.edu', 'root') " | python manage.py shell
type
:
test-python-2.7
script
:
-
pip install tblib
-
python manage.py test --parallel
Go-py3.6
:
image
:
library/python:3.6
type
:
test-3.6
before_script
:
-
python --version
-
apt-get update -qy
-
apt-get install -y libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libjpeg-dev libsasl2-dev
-
pip install -r requirements.txt
-
cd go/
-
cp settings/settings.py.template settings/settings.py
-
cp settings/secret.py.template settings/secret.py
-
export SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9" | fold -w 60 | head -n1 2>/dev/null)
-
export DJANGO_DEBUG="True"
-
sed -i settings/secret.py -e 's/DB_NAME.*/DB_NAME = \"go\"/'
-
sed -i settings/secret.py -e 's/DB_USER.*/DB_USER = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_PASSWORD.*/DB_PASSWORD = \"root\"/'
-
sed -i settings/secret.py -e 's/DB_HOST.*/DB_HOST = \"mysql\"/'
-
sed -i settings/secret.py -e 's/SECRET_KEY.*/SECRET_KEY = \"${SECRET_KEY}\"/'
-
python manage.py makemigrations
-
python manage.py makemigrations go
-
python manage.py migrate
-
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('root', 'root@srct.gmu.edu', 'root') " | python manage.py shell
type
:
test-python-3.6
script
:
-
pip install coverage
-
pip install tblib
-
coverage run --source=go --omit=*migrations/* manage.py test --parallel
-
coverage html -i && grep pc_cov htmlcov/index.html | egrep -o "[0-9]+\%" | awk '{ print "covered " $1;}'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment