Commit 7cbd62f9 authored by Úrsula Iguarán's avatar Úrsula Iguarán 💬 Committed by Andrés Cuberos Lopera

Use pelican cache to speed up builds

parent d355be17
......@@ -21,6 +21,7 @@ builder:
checks:
stage: lint
script:
- if curl --fail -Lo artifacts.zip --header Private-Token:$DOCKER_PASSWD https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=$CI_JOB_NAME; then unzip artifacts.zip; else echo "There are no artifacts"; fi
- ./check-changed.sh
- ./check-all.sh
- ./sass-lint.sh
......@@ -28,6 +29,11 @@ checks:
- for FILE in $(find . -iname '*.adoc'); do sed -i 's/^include::/include::\/builds\/fluidsignal/g' $FILE; done
- pelican --fatal errors --fatal warnings content/
- ./html-lint.sh
artifacts:
when: on_success
expire_in: 18 hrs
paths:
- cache/
except:
- master
......@@ -35,6 +41,7 @@ pages:
stage: deployment
environment: staging
script:
- if curl --fail -Lo artifacts.zip --header Private-Token:$DOCKER_PASSWD https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=deploy; then unzip artifacts.zip; else echo "There are no artifacts"; fi
- sed -i 's/output\/web/public/g' xmlcombine.sh
- sed -i 's/output/public/g' html-lint.sh
- for FILE in $(find . -iname '*.adoc'); do sed -i 's/^include::/include::\/builds\/fluidsignal/g' $FILE; done
......@@ -55,6 +62,8 @@ deploy:
stage: deployment
environment: production
script:
# Download cache from previous builds
- if curl --fail -Lo artifacts.zip --header Private-Token:$DOCKER_PASSWD https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=$CI_JOB_NAME; then unzip artifacts.zip; else echo "There are no artifacts"; fi
# Generate file for localization of the site
- pybabel compile --directory theme/2014/translations/ --domain messages
# Fix links to successfully include files
......@@ -75,5 +84,10 @@ deploy:
# Upload generated output to S3 bucket
- aws s3 rm --recursive s3://web.fluidattacks.com
- aws s3 cp --recursive --acl=public-read-write output/ s3://web.fluidattacks.com
artifacts:
when: on_success
expire_in: 18 hrs
paths:
- cache/
only:
- master
......@@ -6,14 +6,14 @@ COPY . /app
# 18-20: Install basic dependencies to set sources lists
# 22-23: Set sources for NodeJS and Yarn
# 24-46: Install all necessarty dependencies
# 47-48: Download tidy-html binary and install it
# 49-52: Clone the necessaty JS files from the Tipue repository in order to run the plugin
# 53-56: Clone just the plugins that are being used in this project with Pelican
# 57-58: Clone the pleican-redirect plugin (aside from the official repository) and make it recognizable as a module
# 59: Change the default highlighter to Pygments
# 60: Enable every rule of sass-lint
# 61-68: Erase files and directories that are not needed during runtime
# 24-47: Install all necessarty dependencies
# 48-49: Download tidy-html binary and install it
# 50-53: Clone the necessaty JS files from the Tipue repository in order to run the plugin
# 54-57: Clone just the plugins that are being used in this project with Pelican
# 58-59: Clone the pleican-redirect plugin (aside from the official repository) and make it recognizable as a module
# 60: Change the default highlighter to Pygments
# 61: Enable every rule of sass-lint
# 62-69: Erase files and directories that are not needed during runtime
RUN apt-get update -qq && apt-get install -qqy \
curl \
gnupg && \
......@@ -35,6 +35,7 @@ RUN apt-get update -qq && apt-get install -qqy \
python-pip \
python-setuptools \
ruby-full \
unzip \
yarn && \
pip install --upgrade \
pip \
......
......@@ -115,6 +115,11 @@ ASSET_BUNDLES = (
], {'filters': 'scss'}),
)
# Cache Settings
CHECK_MODIFIED_METHOD = 'md5'
CACHE_CONTENT = True
LOAD_CONTENT_CACHE = True
# Disqus
DISQUS_SITENAME = 'fluidsignal'
......
......@@ -118,6 +118,11 @@ ASSET_BUNDLES = (
], {'filters': 'scss'}),
)
# Cache Settings
CHECK_MODIFIED_METHOD = 'md5'
CACHE_CONTENT = True
LOAD_CONTENT_CACHE = True
# Disqus
DISQUS_SITENAME = 'fluidsignal'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment