Skip to content

Commit 8d62e44

Browse files
authored
Re-land treescript fixes from #9 (#63)
* create dockerfile from base of repo instead of inside of script dir * re-land changes from #9 * additional fixes to 6aca865 * pick up versionmanip changes from treescript repo * update worker.yml for treestatus * update changelog * adjust schema * don't require any scopes * vendor robustcheckout.py from version-control-tools 4d4012c0a50f * format robustcheckout with black, fix tests * remove busted purge wrapper * stop using mq
1 parent 2f0de0b commit 8d62e44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4051
-2668
lines changed

.taskcluster.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ tasks:
177177
wget ${REPO_URL}/archive/${HEAD_REV}.tar.gz &&
178178
tar zxf ${HEAD_REV}.tar.gz &&
179179
mv scriptworker-scripts-${HEAD_REV} /src &&
180-
cd /src/${project_name} &&
181-
cp ../docker.d/* docker.d/ &&
180+
cd /src/ &&
181+
cp ${project_name}/docker.d/* docker.d/ &&
182+
cp ${project_name}/Dockerfile . &&
182183
./docker.d/generate_version_json.sh &&
183184
./docker.d/build_image.sh &&
184185
if [ "$PUSH_DOCKER_IMAGE" == "1" ]; then

addonscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ WORKDIR /app
1212
COPY . /app
1313

1414
RUN python -m venv /app \
15-
&& ./bin/pip install -r requirements/base.txt \
16-
&& ./bin/pip install -e . \
15+
&& cd addonscript \
16+
&& /app/bin/pip install -r requirements/base.txt \
17+
&& /app/bin/pip install . \
18+
&& cd /app \
1719
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
1820

1921
CMD ["/app/docker.d/init.sh"]

balrogscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ WORKDIR /app
1212
COPY . /app
1313

1414
RUN python -m venv /app \
15-
&& ./bin/pip install -r requirements/base.txt \
16-
&& ./bin/pip install -e . \
15+
&& cd balrogscript \
16+
&& /app/bin/pip install -r requirements/base.txt \
17+
&& /app/bin/pip install . \
18+
&& cd /app \
1719
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
1820

1921
CMD ["/app/docker.d/init.sh"]

beetmoverscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ WORKDIR /app
1111
COPY . /app
1212

1313
RUN python -m venv /app \
14-
&& ./bin/pip install -r requirements/base.txt \
15-
&& ./bin/pip install -e . \
14+
&& cd beetmoverscript \
15+
&& /app/bin/pip install -r requirements/base.txt \
16+
&& /app/bin/pip install . \
17+
&& cd /app \
1618
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
1719

1820
CMD ["/app/docker.d/init.sh"]

bouncerscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ WORKDIR /app
1111
COPY . /app
1212

1313
RUN python -m venv /app \
14-
&& ./bin/pip install -r requirements/base.txt \
15-
&& ./bin/pip install -e . \
14+
&& cd bouncerscript \
15+
&& /app/bin/pip install -r requirements/base.txt \
16+
&& /app/bin/pip install . \
17+
&& cd /app \
1618
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
1719

1820
CMD ["/app/docker.d/init.sh"]

docker.d/generate_version_json.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ test $GIT_HEAD_REV
55
test $TASK_ID
66
test $TASKCLUSTER_ROOT_URL
77
test $REPO_URL
8+
test $PROJECT_NAME
89

9-
cat > version.json <<EOF
10+
cat > ${PROJECT_NAME}/version.json <<EOF
1011
{
1112
"commit": "${GIT_HEAD_REV}",
12-
"version": "$(cat ./version.txt)",
13+
"version": "$(cat ${PROJECT_NAME}/version.txt)",
1314
"source": "${REPO_URL}",
1415
"build": "${TASKCLUSTER_ROOT_URL}/tasks/${TASK_ID}"
1516
}
1617
EOF
1718

18-
cat ./version.json
19+
cat ${PROJECT_NAME}/version.json

pushapkscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ WORKDIR /app
1414
COPY . /app
1515

1616
RUN python -m venv /app \
17-
&& ./bin/pip install -r requirements/base.txt \
18-
&& ./bin/pip install -e . \
17+
&& cd pushapkscript \
18+
&& /app/bin/pip install -r requirements/base.txt \
19+
&& /app/bin/pip install . \
20+
&& cd /app \
1921
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
2022

2123
CMD ["/app/docker.d/init.sh"]

pushsnapscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ COPY . /app
1919

2020
RUN python -m venv /app \
2121
&& ./bin/pip install --upgrade pip \
22-
&& ./bin/pip install -r requirements/base.txt \
23-
&& ./bin/pip install -e . \
22+
&& cd pushsnapscript \
23+
&& /app/bin/pip install -r requirements/base.txt \
24+
&& /app/bin/pip install . \
25+
&& cd /app \
2426
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
2527

2628
CMD ["/app/docker.d/init.sh"]

shipitscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ WORKDIR /app
1212
COPY . /app
1313

1414
RUN python -m venv /app \
15-
&& ./bin/pip install -r requirements/base.txt \
16-
&& ./bin/pip install -e . \
15+
&& cd shipitscript \
16+
&& /app/bin/pip install -r requirements/base.txt \
17+
&& /app/bin/pip install . \
18+
&& cd /app \
1719
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
1820

1921
CMD ["/app/docker.d/init.sh"]

signingscript/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ USER app
1515
WORKDIR /app
1616

1717
RUN python -m venv /app \
18-
&& ./bin/pip install -r requirements/base.txt \
19-
&& ./bin/pip install -e . \
18+
&& cd signingscript \
19+
&& /app/bin/pip install -r requirements/base.txt \
20+
&& /app/bin/pip install . \
21+
&& cd /app \
2022
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
2123

2224
CMD ["/app/docker.d/init.sh"]

treescript/.coveragerc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
branch = True
3+
omit =
4+
tests/*
5+
.tox/*
6+
treescript/py2/robustcheckout.py

treescript/CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [1.2.1] - 2019-07-XX
5+
## [2.0.0] - 2019-11-xx
6+
### Added
7+
- added l10n bumper support
8+
- added `treestatus_base_url` config
9+
- added mypy check
10+
- added black check
11+
12+
### Changed
13+
- use `scriptworker_client` instead of `scriptworker.client`
14+
- moved src into `src/treescript` and tests into `tests/`
15+
16+
### Fixed
17+
- fixed version bumping on relbranches
18+
19+
## [1.2.1] - 2019-07-08
620

721
### Changed
822
- Use mozilla-version to ensure new Fennec versions are supported

treescript/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ WORKDIR /app
1414
COPY . /app
1515

1616
RUN python -m venv /app \
17-
&& ./bin/pip install -r requirements/base.txt \
18-
&& ./bin/pip install -e . \
17+
&& cd /app/scriptworker_client \
18+
&& /app/bin/pip install -r requirements/base.txt \
19+
&& /app/bin/pip install . \
20+
&& cd /app/treescript \
21+
&& /app/bin/pip install -r requirements/base.txt \
22+
&& /app/bin/pip install . \
23+
&& cd /app \
1924
&& ./bin/pip install https://github.com/rail/configloader/archive/8719e33f6ba65e79e188355efabbcf6c9e1f1780.tar.gz
2025

2126
CMD ["/app/docker.d/init.sh"]

treescript/MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include LICENSE
22
include README.rst
33
include version.txt
4-
include treescript/data/*
5-
include treescript/py2/*
4+
include src/treescript/data/*
5+
include src/treescript/py2/*
66

77
recursive-exclude * __pycache__
88
recursive-exclude * *.py[co]

treescript/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# treescript
2+
3+
Tree-related support, e.g. version bumping and tagging.
4+
5+
This is designed to be run from scriptworker, but runs perfectly fine as a standalone script.
6+
7+
# Update python dependencies
8+
9+
For python version we use in production:
10+
11+
$ docker run -ti -v $PWD:/src -w /src python:3.7 /bin/bash
12+
(docker) /src $ pip install pip-compile-multi
13+
(docker) /src $ pip-compile-multi -g base -g test
14+
15+
For other python versions:
16+
17+
$ docker run -ti -v $PWD:/src -w /src python:3.8 /bin/bash
18+
(docker) /src $ pip install pip-compile-multi
19+
(docker) /src $ pip-compile-multi -g base -g test -o "py38.txt"
20+
21+
Alternately, use `maintenance/pin.sh` .

treescript/README.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

treescript/config_example.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

treescript/config_example.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
work_dir: /tmp/work_dir
2+
artifact_dir: /tmp/artifact_dir
3+
4+
taskcluster_scope_prefix: project:releng:treescript:
5+
6+
hg: hg
7+
hg_share_base_dir: /tmp/hg_share_base
8+
upstream_repo: https://hg.mozilla.org/mozilla-unified
9+
treestatus_base_url: https://treestatus.mozilla-releng.net
10+
11+
hg_ssh_user: some_user
12+
hg_ssh_keyfile: some_file.rsa

treescript/docker.d/worker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ work_dir: { "$eval": "WORK_DIR" }
22
artifact_dir: { "$eval": "ARTIFACTS_DIR" }
33
verbose: { "$eval": "VERBOSE == 'true'" }
44
taskcluster_scope_prefix: { "$eval": "TASKCLUSTER_SCOPE_PREFIX" }
5+
treestatus_base_url: https://treestatus.mozilla-releng.net
56
hg: 'hg'
67
hg_share_base_dir: { "$eval": "HG_SHARE_BASE_DIR" }
78
upstream_repo: 'https://hg.mozilla.org/mozilla-unified'

treescript/mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[mypy]
2+
python_version = 3.7
3+
ignore_missing_imports = True

treescript/requirements/base.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
mozilla-version
2-
scriptworker !=13.0
3-
taskcluster

treescript/requirements/test.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
coverage>=4.2
44
flake8
55
flake8_docstrings
6+
flake8-per-file-ignores
67
mock
78
pytest
89
pytest-asyncio
10+
pytest-black
911
pytest-cov
1012
pytest-mock
1113
tox

treescript/setup.cfg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[bdist_wheel]
2+
universal = 1
3+
4+
[flake8]
5+
max-line-length = 140
6+
exclude = tests/*
7+
max-complexity=10
8+
9+
[tool:pytest]
10+
norecursedirs =
11+
.git
12+
.tox
13+
.env
14+
dist
15+
build
16+
python_files =
17+
test_*.py
18+
*_test.py
19+
tests.py
20+
addopts =
21+
-rxEfsw
22+
--strict
23+
--doctest-modules
24+
--doctest-glob=\*.rst
25+
--tb=short
26+
27+
[options]
28+
package_dir=
29+
=src
30+
packages=find:
31+
32+
[options.packages.find]
33+
where=src

treescript/setup.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,23 @@
55
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), "version.txt")) as f:
66
version = f.read().rstrip()
77

8+
with open(
9+
os.path.join(os.path.abspath(os.path.dirname(__file__)), "requirements", "base.in")
10+
) as f:
11+
install_requires = ["scriptworker_client"] + f.readlines()
12+
813
setup(
914
name="treescript",
1015
version=version,
1116
description="Tree Modifying Script",
1217
author="Mozilla Release Engineering",
1318
author_email="[email protected]",
14-
url="https://github.com/mozilla-releng/treescript",
19+
url="https://github.com/mozilla-releng/scriptworker-scripts",
1520
packages=find_packages(),
1621
package_data={"treescript": ["data/*", "py2/*"]},
1722
include_package_data=True,
1823
zip_safe=False,
19-
entry_points={
20-
"console_scripts": [
21-
"treescript = treescript.script:main",
22-
],
23-
},
24+
entry_points={"console_scripts": ["treescript = treescript.script:main"]},
2425
license="MPL2",
25-
install_requires=[
26-
"mozilla-version",
27-
"scriptworker",
28-
"taskcluster"
29-
],
26+
install_requires=install_requires,
3027
)
File renamed without changes.

0 commit comments

Comments
 (0)