Gitlab CI For the WIN!

new file:   .gitlab-ci.yml
This commit is contained in:
Russell Ballestrini 2022-01-10 15:05:37 -05:00
parent 03680800a8
commit 3c0d2e9758

44
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,44 @@
stages:
- test
- build
- publish
test:
stage: test
script: make test
artifacts:
paths:
- env.vanilla
expire_in: 1 hour
build:
stage: build
script:
- mv env.vanilla env
- make prod
# copy static assets to env/static
- cp -pr make_post_sell/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 /www/my.makepostsell.com/env
# make tarball of virtualenv.
- tar -zcf env.tar.gz -C /www/my.makepostsell.com .
# 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 /www/my.makepostsell.com
artifacts:
paths:
- env.tar.gz
- static.tar.gz
- commit-hash.txt
expire_in: 1 month
publish:
stage: publish
script:
# publish build to Salt Master
- sudo /opt/salt-call-put-artifacts-onto-salt-master.sh