Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
a084139f
Commit
a084139f
authored
Jul 30, 2016
by
David Haynes
Browse files
use before_script properly
- also test passses again
parent
3598dee4
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
a084139f
...
@@ -10,29 +10,9 @@ variables:
...
@@ -10,29 +10,9 @@ variables:
MYSQL_DATABASE
:
go
MYSQL_DATABASE
:
go
MYSQL_ROOT_PASSWORD
:
root
MYSQL_ROOT_PASSWORD
:
root
before_script
:
script
:
-
apt-get update -qy
-
apt-get install -y python-dev python-pip python-pip libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libsasl2-dev libjpeg-dev git
-
pip install -r requirements.txt
-
cp go/settings/settings.py.template go/settings/settings.py
-
cp go/settings/secret.py.template go/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)
-
sed -i go/settings/secret.py -e 's/DB_NAME.*/DB_NAME = \"go\"/'
-
sed -i go/settings/secret.py -e 's/DB_USER.*/DB_USER = \"root\"/'
-
sed -i go/settings/secret.py -e 's/DB_PASSWORD.*/DB_PASSWORD = \"root\"/'
-
sed -i go/settings/secret.py -e 's/DB_HOST.*/DB_HOST = \"mysql\"/'
-
sed -i go/settings/secret.py -e 's/SECRET_KEY.*/SECRET_KEY = \"${SECRET_KEY}\"/'
-
cd go
-
export DJANGO_DEBUG="True"
-
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
test_Go
:
test_Go
:
type
:
test
type
:
test
script
:
before_
script
:
-
apt-get update -qy
-
apt-get update -qy
-
apt-get install -y python-dev python-pip python-pip libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libsasl2-dev libjpeg-dev git
-
apt-get install -y python-dev python-pip python-pip libldap2-dev mysql-client libmysqlclient-dev python-mysqldb libsasl2-dev libjpeg-dev git
-
pip install -r requirements.txt
-
pip install -r requirements.txt
...
@@ -50,4 +30,5 @@ test_Go:
...
@@ -50,4 +30,5 @@ test_Go:
-
python manage.py makemigrations go
-
python manage.py makemigrations go
-
python manage.py migrate
-
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
-
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
script
:
-
python manage.py test
-
python manage.py test
go/go/test_models.py
View file @
a084139f
...
@@ -5,4 +5,4 @@ from go.models import URL, RegisteredUser
...
@@ -5,4 +5,4 @@ from go.models import URL, RegisteredUser
class
URLTestCase
(
TestCase
):
class
URLTestCase
(
TestCase
):
def
test_Django_Test
(
self
):
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World"
)
self
.
assertEqual
(
"Hello World!"
,
"Hello World
!
"
)
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