remarkbox/.gitlab-ci.yml
russell@unturf.com ddbcdfa094 ci: install and bundle remarkbox-theme-chaostheory
Adds chaostheory theme to the shared env.tar.gz build so foxhop.net
(which sets app.theme = chaostheory and shares /opt/remarkbox/env with
my.remarkbox.com) has the theme's templates + static assets available
after deploy.
2026-04-21 18:27:49 -04:00

76 lines
2.1 KiB
YAML

stages:
- test
- build
- deploy
- pypi-twine
test:
stage: test
tags: ["build"]
except:
- tags
script:
- make venv
- env/bin/pip install 'setuptools<81'
- make test
build:
stage: build
tags: ["build"]
except:
- tags
script:
- make venv
- env/bin/pip install 'setuptools<81'
- make install-source-prod
# Copy static assets to env/static
- cp -pr remarkbox/static env/static
# Copy static assets to env/static for westworld theme.
- cp -pr env/lib/python*/site-packages/remarkbox_westworld/static/* env/static
# Copy static assets to env/static for meta theme.
- cp -pr env/lib/python*/site-packages/remarkbox_theme_meta/static/* env/static
# Copy static assets to env/static for chaostheory theme.
- cp -pr env/lib/python*/site-packages/remarkbox_chaostheory/static/* env/static
# Make tarball of the static files.
- cp -pr env/static static
- tar -zcf static.tar.gz static
# Clean up the directory outside of the gitlab-runner filesystem.
- rm -rf /opt/remarkbox/env
# Clone the virtualenv with virtualenv-clone into the desired location.
- virtualenv-clone -vvv $PWD/env /opt/remarkbox/env
# Create commit-hash.txt to track this build's git commit hash.
- echo $CI_COMMIT_SHA >> commit-hash.txt
# Place it inside the virtualenv before creating the tarball.
- cp commit-hash.txt /opt/remarkbox/env/commit-hash.txt
# Create a tarball of the virtualenv.
- tar -zcf env.tar.gz -C /opt/remarkbox .
# Create a SHA512 hash of env.tar.gz.
- sha512sum env.tar.gz >> env.tar.gz.hash
artifacts:
paths:
- env.tar.gz
- env.tar.gz.hash
- static.tar.gz
- commit-hash.txt
expire_in: 1 month
when: always
deploy:
stage: deploy
needs: [build]
rules:
- if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"'
when: on_success
trigger:
include: .gitlab-ci.deploy.yml
pypi-twine:
stage: pypi-twine
tags:
- build
only:
- tags
script:
- make twine-upload