54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
stages:
|
|
- test
|
|
- build
|
|
- deploy
|
|
|
|
test:
|
|
stage: test
|
|
tags: ["build"]
|
|
script: make test
|
|
artifacts:
|
|
paths:
|
|
- env.vanilla
|
|
expire_in: 1 hour
|
|
|
|
build:
|
|
stage: build
|
|
tags: ["build"]
|
|
script:
|
|
- ls -hal
|
|
- mv env.vanilla env
|
|
- make 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.
|
|
- cp -pr env/lib/python*/site-packages/remarkbox_theme_meta/static/* env/static
|
|
# make tarball of the static files.
|
|
- cp -pr env/static static
|
|
# create a tarball of the static files.
|
|
- tar -zcf static.tar.gz static
|
|
# move the virtualenv with virtualenv-clone into desired location.
|
|
- virtualenv-clone env /opt/remarkbox/env
|
|
# make tarball of virtualenv.
|
|
- tar -zcf env.tar.gz -C /opt/remarkbox .
|
|
# create sha512 of into the file named env.tar.gz.hash
|
|
- sha512sum env.tar.gz >> env.tar.gz.hash
|
|
# create commit-hash.txt to track this build's git commit hash.
|
|
- echo $CI_COMMIT_SHA >> commit-hash.txt
|
|
# clean up directory outside of gitlab-runner filesystem.
|
|
- rm -rf /opt/remarkbox/env
|
|
artifacts:
|
|
paths:
|
|
- env.tar.gz
|
|
- env.tar.gz.hash
|
|
- static.tar.gz
|
|
- commit-hash.txt
|
|
expire_in: 1 month
|
|
|
|
deploy:
|
|
stage: deploy
|
|
needs: [build]
|
|
trigger:
|
|
include: .gitlab-ci.deploy.yml
|