Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cube-doctor
Commits
16b77072227e
Commit
617242c1
authored
Aug 05, 2021
by
Noé Gaumont
🐙
Browse files
fix: remove add-deb-publish
parent
9cf0c8d5f03a
Pipeline
#74001
passed with stage
in 1 minute and 5 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cube_doctor/doctor_hg.py
View file @
16b77072
...
...
@@ -6,7 +6,6 @@ from cube_doctor import EmptyCubeQueryResult
from
cube_doctor.transforms.add_tox
import
AddTox
# noqa
from
cube_doctor.transforms.add_pypi_publish
import
AddPypiPublish
from
cube_doctor.transforms.add_deb_publish
import
AddDebPublish
from
cube_doctor.transforms.automatic_upgrade_of_dependencies
import
(
AutoUpgradeDependencies
,
)
...
...
@@ -90,7 +89,6 @@ commands = {
# "add-tox": AddTox().workflow,
"add-pytest-deprecated-warnings-cmd"
:
CaptureDeprecatedWarnings
().
workflow
,
"add-pypi-publish"
:
AddPypiPublish
().
workflow
,
"add-deb-publish"
:
AddDebPublish
().
workflow
,
"add-yamllint"
:
AddYamlLint
().
workflow
,
"add-release-new"
:
AddReleaseNew
().
workflow
,
"replace-set-attributes"
:
ReplaceSetAttributesWithSetCW
().
workflow
,
...
...
cube_doctor/transforms/add_deb_publish.py
deleted
100644 → 0
View file @
9cf0c8d5
from
tox.config
import
parseconfig
from
cube_doctor
import
Command
DEB_PUBLISHED
=
"""
[testenv:deb-publish]
passenv = JENKINS_USER JENKINS_TOKEN
basepython = python3
skip_install = true
whitelist_externals =
rm
sh
hg
python3
deps =
httpie
commands =
hg clean --all --dirs --files
rm -rf build dist .egg .egg-info
python3 setup.py sdist
sh -c "PACKAGE_NAME=$(python3 setup.py --name) && VERSION=$(python3 setup.py --version) &&
\\
cd dist &&
\\
tar xf $PACKAGE_NAME-$VERSION.tar.gz &&
\\
cd $PACKAGE_NAME-$VERSION &&
\\
cp -a {toxinidir}/debian . &&
\\
mk-origtargz --rename ../$PACKAGE_NAME-$VERSION.tar.gz &&
\\
dpkg-buildpackage -us -uc --no-check-builddeps --build=source "
sh -c "cd dist && dcmd zip latest.zip *.changes"
http -f POST https://{env:JENKINS_USER}:{env:JENKINS_TOKEN}@jenkins.intra.logilab.fr/job/pkg-from-dsc/buildWithParameters DIST=buster source.zip@dist/latest.zip REPO=buster PUBLISH=true
"""
# noqa
class
AddDebPublish
(
Command
):
BRANCH_NAME
=
"topic/default/deb-publish"
commit_message
=
"chore(tox): add deb-publish"
TARGETS
=
(
"cubes"
,)
base_query
=
"?project lgg:has_deb_publish false . "
"?project lgg:has_tox true ."
NO_AUTO_MR
=
False
def
pre_check
(
self
,
root_files
):
if
"tox.ini"
not
in
root_files
:
return
"continue"
if
"setup.py"
not
in
root_files
:
return
"continue"
def
modify_code
(
self
,
cube
,
repo
,
root_files
,
branches
,
other_args
):
tox_ini_path
=
repo
.
path
/
"tox.ini"
tox
=
parseconfig
([
"-c"
,
str
(
tox_ini_path
)])
if
"deb-publish"
in
tox
.
envconfigs
:
return
tox_content
=
repo
.
read_file
(
"tox.ini"
)
tox_content
=
tox_content
.
rstrip
()
+
DEB_PUBLISHED
repo
.
write_file
(
"tox.ini"
,
tox_content
)
yield
{
"branch_name"
:
self
.
BRANCH_NAME
,
"commit_message"
:
self
.
commit_message
}
tests/data/add_deb_publish/in/tox.ini
deleted
100644 → 0
View file @
9cf0c8d5
[tox]
envlist
=
py3
[testenv]
deps
=
pytest
commands
=
{envpython}
-m
pytest
{posargs:test}
tests/data/add_deb_publish/out/tox.ini
deleted
100644 → 0
View file @
9cf0c8d5
[tox]
envlist
=
py3
[testenv]
deps
=
pytest
commands
=
{envpython}
-m
pytest
{posargs:test}
[testenv:deb-publish]
passenv
=
JENKINS_USER JENKINS_TOKEN
basepython
=
python3
skip_install
=
true
whitelist_externals
=
rm
sh
hg
python3
deps
=
httpie
commands
=
hg
clean
--all
--dirs
--files
rm
-rf
build
dist
.egg
.egg-info
python3
setup.py
sdist
sh
-c
"
PACKAGE_NAME
=
$(python3 setup.py --name) && VERSION=$(python3 setup.py --version) &&
\
cd dist &&
\
tar xf $PACKAGE_NAME-$VERSION.tar.gz &&
\
cd $PACKAGE_NAME-$VERSION &&
\
cp -a {toxinidir}/debian . &&
\
mk-origtargz --rename ../$PACKAGE_NAME-$VERSION.tar.gz &&
\
dpkg-buildpackage -us -uc --no-check-builddeps --build=source "
sh
-c
"cd
dist
&&
dcmd
zip
latest.zip
*.changes"
http
-f
POST
https://{env:JENKINS_USER}:{env:JENKINS_TOKEN}@jenkins.intra.logilab.fr/job/pkg-from-dsc/buildWithParameters
DIST
=
buster source.zip@dist/latest.zip REPO=buster PUBLISH=true
tests/test_deb_publish.py
deleted
100644 → 0
View file @
9cf0c8d5
import
unittest
from
cube_doctor.transforms.add_deb_publish
import
AddDebPublish
from
.
import
BaseCommandTC
,
TEST_DATA
class
AddDebPublishTC
(
BaseCommandTC
):
def
test_adddebpublish
(
self
):
data_input
=
TEST_DATA
/
"add_deb_publish"
/
"in"
data_output
=
TEST_DATA
/
"add_deb_publish"
/
"out"
self
.
base_execution
(
AddDebPublish
(),
data_input
,
data_output
)
def
test_adddebpublish_indempotent
(
self
):
data_output
=
TEST_DATA
/
"add_deb_publish"
/
"out"
self
.
base_execution
(
AddDebPublish
(),
data_output
,
data_output
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment