build and test django in Jenkinsfile

This commit is contained in:
s460930 2020-12-01 19:46:23 +01:00
parent 6c29a37ae5
commit 1224e35bfe
9 changed files with 13 additions and 58 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.idea/
.idea/*
*.iml
.idea
*__pycache__/

8
.idea/.gitignore vendored
View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Python" name="Python">
<configuration sdkName="Python 3.8" />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/rest-app" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Python 3.8 interpreter library" level="application" />
</component>
</module>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="db" uuid="7f4bb91e-1fe8-4fbb-957b-243ac1847b2b">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/rest-app/db.sqlite3</jdbc-url>
</data-source>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/SmartPicasso.iml" filepath="$PROJECT_DIR$/.idea/SmartPicasso.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

9
Jenkinsfile vendored
View File

@ -2,9 +2,16 @@ pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'cd rest-app'
sh 'pip3 install -r requirements.txt'
}
}
stage('Test') {
steps {
echo 'Test pipeline'
sh 'cd rest-app'
sh 'python3 manage.py test'
}
}
}

View File

@ -0,0 +1,3 @@
django
djangorestframework
djangorestframework-jwt