80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
stages:
|
|
- test
|
|
- build
|
|
- deploy
|
|
- pypi-twine
|
|
|
|
test:
|
|
stage: test
|
|
tags: ["build"]
|
|
except:
|
|
- tags
|
|
script: make test
|
|
artifacts:
|
|
paths:
|
|
- env.vanilla
|
|
expire_in: 1 hour
|
|
|
|
build:
|
|
stage: build
|
|
tags: ["build"]
|
|
except:
|
|
- tags
|
|
script:
|
|
- mv env.vanilla env
|
|
- make install-source-prod
|
|
# Copy static assets to env/static and create a tarball of the static files.
|
|
- cp -pr make_post_sell/static env/static
|
|
- cp -pr env/static static
|
|
- tar -zcf static.tar.gz static
|
|
# Clone the virtualenv with virtualenv-clone into the desired location.
|
|
- virtualenv-clone -vvv env /opt/make_post_sell/env
|
|
# Create a tarball of the virtualenv.
|
|
- tar -zcf env.tar.gz -C /opt/make_post_sell .
|
|
# Create SHA512 hash of env.tar.gz.
|
|
- 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 the directory outside of the gitlab-runner filesystem.
|
|
- rm -rf /opt/make_post_sell/env
|
|
artifacts:
|
|
paths:
|
|
- env.tar.gz
|
|
- env.tar.gz.hash
|
|
- static.tar.gz
|
|
- commit-hash.txt
|
|
expire_in: 1 month
|
|
|
|
|
|
memopoly.com:
|
|
stage: deploy
|
|
tags: ["memopoly.com"]
|
|
script:
|
|
# publish build to Salt Master
|
|
- sudo /opt/salt-call-state-highstate.sh
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "develop"'
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
|
|
|
|
my.makepostsell.com:
|
|
stage: deploy
|
|
tags: ["my.makepostsell.com"]
|
|
script:
|
|
# publish build to Salt Master
|
|
- sudo /opt/salt-call-state-highstate.sh
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
|
|
|
|
pypi-twine:
|
|
stage: pypi-twine
|
|
tags:
|
|
- build
|
|
only:
|
|
- tags
|
|
script:
|
|
- pip install --upgrade pip
|
|
- pip install twine
|
|
- python3 setup.py sdist bdist_wheel
|
|
- twine upload dist/*
|