diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 205d949e140aec319aad5823771b7b103eec7445..b3bf5524f4b068bb0e42bf482be3cdb6ac3774ba 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,8 +15,8 @@ before_script:
 
 Build:
   script:
-    - docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
-    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+    - docker build --pull -t $CI_REGISTRY_IMAGE:tmp .
+    - docker push $CI_REGISTRY_IMAGE:tmp
   stage: build
   tags:
   - docker
@@ -25,8 +25,8 @@ Push development:
   only:
     - development
   script:
-    - docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:development
+    - docker pull $CI_REGISTRY_IMAGE:tmp
+    - docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:development
     - docker push $CI_REGISTRY_IMAGE:development
   stage: push
   tags:
@@ -36,8 +36,8 @@ Push latest:
   only:
     - master
   script:
-    - docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
+    - docker pull $CI_REGISTRY_IMAGE:tmp
+    - docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:latest
     - docker push $CI_REGISTRY_IMAGE:latest
   stage: push
   tags:
@@ -47,8 +47,8 @@ Push tag:
   only:
     - tags
   script:
-    - docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-    - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
+    - docker pull $CI_REGISTRY_IMAGE:tmp
+    - docker tag $CI_REGISTRY_IMAGE:tmp $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
     - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
   stage: push
   tags:
diff --git a/app/corpora/views.py b/app/corpora/views.py
index aef61908b3a7d4224f5a7ef8912b012e21bfe347..3a06b20485e44f66b232a653db13c0eb16104aad 100644
--- a/app/corpora/views.py
+++ b/app/corpora/views.py
@@ -19,7 +19,7 @@ def add_corpus():
     if add_corpus_form.validate_on_submit():
         corpus = Corpus(creator=current_user,
                         description=add_corpus_form.description.data,
-                        title=add_corpus_form.title.data)
+                        status='unprepared', title=add_corpus_form.title.data)
         db.session.add(corpus)
         db.session.commit()
         dir = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
@@ -113,6 +113,7 @@ def add_corpus_file(corpus_id):
                                  corpus=corpus, dir=dir, filename=filename,
                                  publishing_year=add_corpus_file_form.publishing_year.data,
                                  title=add_corpus_file_form.title.data)
+        corpus_file.insert_metadata()
         db.session.add(corpus_file)
         db.session.commit()
         flash('Corpus file added!')
@@ -166,6 +167,7 @@ def edit_corpus_file(corpus_id, corpus_file_id):
         corpus_file.author = edit_corpus_file_form.author.data
         corpus_file.publishing_year = edit_corpus_file_form.publishing_year.data
         corpus_file.title = edit_corpus_file_form.title.data
+        corpus_file.insert_metadata()
         db.session.commit()
         flash('Corpus file edited!')
         return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
diff --git a/app/models.py b/app/models.py
index 77892c02b1420f4fd40d7ca2e9e83e2273d7acde..ac5578d1f4f495cc0a2389eaedb99ce05d764fdf 100644
--- a/app/models.py
+++ b/app/models.py
@@ -424,6 +424,9 @@ class CorpusFile(db.Model):
         db.session.delete(self)
         db.session.commit()
 
+    def insert_metadata(self):
+        pass
+
 
 class Corpus(db.Model):
     """
@@ -436,16 +439,12 @@ class Corpus(db.Model):
     description = db.Column(db.String(255))
     title = db.Column(db.String(32))
     user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
-    status = db.Column(db.String(16))
     # Relationships
     files = db.relationship('CorpusFile',
                             backref='corpus',
                             lazy='dynamic',
                             cascade='save-update, merge, delete')
 
-    def __init__(self, **kwargs):
-        super(Corpus, self).__init__(**kwargs)
-
     def __repr__(self):
         """
         String representation of the corpus. For human readability.
@@ -482,6 +481,9 @@ class Corpus(db.Model):
         db.session.delete(self)
         db.session.commit()
 
+    def prepare(self):
+        pass
+
 
 '''
 ' Flask-Login is told to use the application’s custom anonymous user by setting
diff --git a/app/utils.py b/app/utils.py
index 7c1d9638dc5ce66607d3b7b7a0572d172b8165bd..6eae9d54dde739708d8a53edba6d9ffeecb72d44 100644
--- a/app/utils.py
+++ b/app/utils.py
@@ -1,4 +1,4 @@
-from .models import Job, User, Corpus
+from .models import Job, User, Corpus, CorpusFile
 from . import db
 import logging
 
@@ -64,3 +64,8 @@ def background_delete_corpus(app, corpus_id):
         logger.warning('Corpus id is: {}.'.format(corpus_id))
         corpus = Corpus.query.filter_by(id=corpus_id).first()
         corpus.delete()
+
+
+def background_prepare_corpus_file(app, corpus_file_id):
+    with app.app_context():
+        corpus_file = CorpusFile.query.filter_by(id=corpus_file_id).first()