提交 addb8f02 编写于 作者: T ToBeADevOps

第一次自动化打包部署

上级 3ba7318b
此差异已折叠。
FROM python:3.8.5
COPY dist/django-PACP-0.1.tar.gz /usr/src/app
RUN cd /usr/src/app && \
tar zxvf django-PACP-0.1.tar.gz && \
pip install -r requirements.txt
CMD ["python", "manage.py", "runserver"]
\ No newline at end of file
......@@ -16,11 +16,9 @@ pipeline {
}
stage('Build') {
options {
timeout(time: 5, unit: 'SECONDS')
}
steps {
bat 'python manage.py runserver'
echo 'start Build...'
sh 'sh Package.sh'
}
}
......@@ -33,6 +31,7 @@ pipeline {
stage('Deploy') {
steps {
echo 'start Deploy...'
sh 'docker build -t PACP .'
}
}
......
include LICENSE
include README.md
include manage.py
include requirements.txt
recursive-include static *
recursive-include templadtes *
\ No newline at end of file
#!/bin/bash
if ls | gerp -w "dist"; then
rm -r dist
fi
if ls | gerp -w "django_PACP.egg-info"; then
rm -r django_PACP.egg-info
fi
python setup.py sdist
\ No newline at end of file
import pymysql
pymysql.install_as_MySQLdb()
\ No newline at end of file
# import pymysql
# pymysql.install_as_MySQLdb()
......@@ -15,8 +15,6 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
......@@ -28,7 +26,6 @@ DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
......@@ -55,7 +52,7 @@ ROOT_URLCONF = 'Poetry_AE.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'templates')],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -70,22 +67,13 @@ TEMPLATES = [
WSGI_APPLICATION = 'Poetry_AE.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test',
'USER':'root',
'PASSWORD':'123456',
'HOST':'127.0.0.1',
'PORT':'3306'
}
'default': {}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
......@@ -104,7 +92,6 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
......@@ -118,11 +105,10 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR,"static"),
]
\ No newline at end of file
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
[metadata]
name = django-PACP
version = 0.1
description = A Django app to conduct Web-based Poetry-appreciation-and-communication-platform.
long_description = file: README.md
url = https://www.example.com/
author = TOBEALISTENER
author_email = seeuzh@163.com
license = MIT
classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.1
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content
[options]
include_package_data = true
packages = find:
\ No newline at end of file
from setuptools import setup
setup()
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册