Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses BasePackage model from asterism #138

Merged
merged 4 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ before_install:
- docker-compose up -d
- sleep 20s
- docker-compose exec gemini-web pip install coverage pre-commit
- docker-compose exec pisces-web pre-commit install
- docker-compose exec gemini-web pre-commit install
install: true
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- docker-compose exec pisces-web pre-commit run --all-files --show-diff-on-failure
- docker-compose exec gemini-web pre-commit run --all-files --show-diff-on-failure
- docker-compose exec gemini-web coverage run manage.py test
after_script:
- docker-compose exec gemini-web coverage xml
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ ! -f gemini/config.py ]; then
fi

echo "Apply database migrations"
python manage.py makemigrations && python manage.py migrate
python manage.py migrate

echo "Starting server"
python manage.py runserver 0.0.0.0:8006
1 change: 1 addition & 0 deletions gemini/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'rest_framework',
'health_check',
'storer',
'asterism',
]

MIDDLEWARE = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ clinner==1.12.3
colorlog==4.0.2
Django==2.2.10
djangorestframework==3.10.3
git+https://github.com/RockefellerArchiveCenter/asterism@v0.2.1#egg=asterism
git+https://github.com/RockefellerArchiveCenter/asterism@v0.4.1#egg=asterism
gitdb2==2.0.6
GitPython==3.0.5
health-check==3.4.1
Expand Down
39 changes: 39 additions & 0 deletions storer/migrations/0005_auto_20200317_0248.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 2.2.10 on 2020-03-17 02:48

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('storer', '0004_auto_20200220_0458'),
]

operations = [
migrations.AddField(
model_name='package',
name='bag_identifier',
field=models.CharField(blank=True, max_length=255),
),
migrations.AddField(
model_name='package',
name='bag_path',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AlterField(
model_name='package',
name='data',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='package',
name='process_status',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='package',
name='type',
field=models.CharField(blank=True, choices=[('aip', 'Archival Information Package'), ('dip', 'Dissemination Information Package')], max_length=50, null=True),
),
]
24 changes: 4 additions & 20 deletions storer/models.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
from django.contrib.postgres.fields import JSONField
from asterism.models import BasePackage
from django.db import models


class Package(models.Model):
created = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)
TYPE_CHOICES = (
('aip', 'Archival Information Package'),
('dip', 'Dissemination Information Package'),
)
type = models.CharField(max_length=50, choices=TYPE_CHOICES)
data = JSONField()
class Package(BasePackage):
BasePackage._meta.get_field("bag_identifier").blank = True
BasePackage._meta.get_field("bag_identifier")._unique = False
DOWNLOADED = 10
STORED = 20
DELIVERED = 25
Expand All @@ -21,16 +15,6 @@ class Package(models.Model):
(DELIVERED, 'Package data delivered'),
(CLEANED_UP, 'Package cleaned up')
)
process_status = models.CharField(max_length=50, choices=PROCESS_STATUS_CHOICES, default=10)
internal_sender_identifier = models.CharField(max_length=60, null=True, blank=True)
fedora_uri = models.CharField(max_length=255, null=True, blank=True)
ORIGIN_CHOICES = (
('aurora', 'Aurora'),
('legacy_digital', 'Legacy Digital Processing'),
('digitization', 'Digitization')
)
origin = models.CharField(
max_length=20,
choices=ORIGIN_CHOICES,
default='aurora')
archivesspace_uri = models.CharField(max_length=255, null=True, blank=True)