Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
duniter-mirage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
duniter-mirage
Commits
3d1325ea
Commit
3d1325ea
authored
5 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[enh] add deploy tools
parent
8de47974
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+84
-24
84 additions, 24 deletions
.gitlab-ci.yml
mirage/__init__.py
+2
-0
2 additions, 0 deletions
mirage/__init__.py
release.sh
+8
-3
8 additions, 3 deletions
release.sh
requirements_deploy.txt
+3
-0
3 additions, 0 deletions
requirements_deploy.txt
with
97 additions
and
27 deletions
.gitlab-ci.yml
+
84
−
24
View file @
3d1325ea
stages
:
-
github-sync
-
test
-
build
-
release
variables
:
...
...
@@ -7,41 +8,100 @@ variables:
image
:
registry.duniter.org/docker/python3/duniterpy-builder:0.0.4
.pyenv
:
&pyenv
tags
:
-
redshift-docker-python
before_script
:
-
export PYENV_ROOT="$HOME/.pyenv"
-
export PATH="$PYENV_ROOT/bin:$PATH"
-
eval "$(pyenv init -)"
-
pyenv shell $PYENV_PYTHON_VERSION
push_to_github
:
stage
:
github-sync
variables
:
GIT_STRATEGY
:
none
# SUB-TASKS
.push_to_github
:
tags
:
-
github
script
:
after_script
:
# remove all files in current repo
-
rm -rf ./*
-
rm -rf .git
-
rm -rf .git*
# do a mirror clone in current repo
-
git clone --mirror $CI_REPOSITORY_URL .
# do config for github push
-
git remote add github $GITHUB_URL_AND_KEY
-
git config --global user.email "contact@duniter.org"
-
git config --global user.name "Duniter"
#
Job would fail if we don't
remove refs about
pull
requests
-
bash -c "cat packed-refs | grep -v 'refs/
pull
' > packed-refs-new; echo 'Removed
pull
refs.'"
# remove refs about
merge
requests
-
bash -c "cat packed-refs | grep -v 'refs/
merge-requests
' > packed-refs-new; echo 'Removed
merge-requests
refs.'"
-
mv packed-refs-new packed-refs
# github push
-
bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
.pyenv
:
tags
:
-
redshift-docker-python
before_script
:
-
export PYENV_ROOT="$HOME/.pyenv"
-
export PATH="$PYENV_ROOT/bin:$PATH"
-
eval "$(pyenv init -)"
-
pyenv shell $PYENV_PYTHON_VERSION
.changes
:
only
:
changes
:
-
duniterpy/**/*.py
-
.gitlab-ci.yml
-
Makefile
-
requirements_dev.txt
-
requirements.txt
-
setup.py
# TASKS
format
:
extends
:
-
.pyenv
-
.changes
stage
:
test
script
:
-
pyenv shell 3.6.4
# black install and run needs python 3.6.x minimum
-
pip install -r requirements_dev.txt
-
make check-format
check
:
extends
:
-
.pyenv
-
.changes
stage
:
test
script
:
-
pyenv shell 3.6.4
# black install needs python 3.6.x minimum
-
pip install -r requirements.txt
-
pip install -r requirements_dev.txt
-
make mypy
-
make pylint
build
:
extends
:
-
.pyenv
-
.changes
stage
:
build
script
:
-
pip install -r requirements.txt
-
pip install -r requirements_deploy.txt
-
make build
release
:
extends
:
-
.pyenv
-
.push_to_github
stage
:
release
when
:
manual
script
:
-
pip install -r requirements.txt
-
pip install -r requirements_deploy.txt
-
make build
-
make deploy PYPI_LOGIN=${PYPI_LOGIN} PYPI_PASSWORD=${PYPI_PASSWORD}
only
:
-
tags
-
master
release
s
:
<<
:
*
pyenv
release
_test
:
extends
:
.
pyenv
stage
:
release
when
:
manual
script
:
-
pip install -r requirements.txt
-
pip install
wheel
-
pip install twine
-
python setup.py sdist bdist_wheel
-
twine upload dist/* --username duniter --password $PYPI_PASSWORD
-
pip install
-r requirements_deploy.txt
-
make build
-
make deploy_test PYPI_TEST_LOGIN=${PYPI_TEST_LOGIN} PYPI_TEST_PASSWORD=${PYPI_TEST_PASSWORD}
This diff is collapsed.
Click to expand it.
mirage/__init__.py
+
2
−
0
View file @
3d1325ea
from
.node
import
Node
from
.user
import
User
from
.block_forge
import
BlockForge
__version__
=
"
0.1.15
"
This diff is collapsed.
Click to expand it.
release.sh
+
8
−
3
View file @
3d1325ea
#!/bin/bash
#__version__ = '0.20.1dev9'
current
=
`
grep
-P
"version
=
\"\d
+.
\d
+.
\d
+(
\w
*)
\"
"
setup
.py |
grep
-oP
"
\d
+.
\d
+.
\d
+(
\w
*)"
`
current
=
`
grep
-P
"
__
version
__ =
\"\d
+.
\d
+.
\d
+(
\w
*)
\"
"
mirage/__init__
.py |
grep
-oP
"
\d
+.
\d
+.
\d
+(
\w
*)"
`
echo
"Current version:
$current
"
if
[[
$1
=
~ ^[0-9]+.[0-9]+.[0-9]+[0-9a-z]
*
$
]]
;
then
sed
-i
"s/version=
\"
$current
\"
/version=
\"
$1
\"
/g"
setup.py
git commit setup.py
-m
"
$1
"
# update version in mirage
sed
-i
"s/__version__ =
\"
$current
\"
/__version__ =
\"
$1
\"
/g"
mirage/__init__.py
# update version in setup.py
sed
-i
"s/version=
\"
$current
\"
,/version=
\"
$1
\"
,/"
setup.py
# commit changes and add version tag
git commit setup.py mirage/__init__.py
-m
"
$1
"
git tag
"
$1
"
-a
-m
"
$1
"
else
echo
"Wrong version format"
...
...
This diff is collapsed.
Click to expand it.
requirements_deploy.txt
0 → 100644
+
3
−
0
View file @
3d1325ea
setuptools
wheel
twine
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment