Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3430ff8069 | |||
| 380c983a27 | |||
| 1e65e9b513 | |||
| 2a533ac5f5 | |||
| 9f7399722f | |||
| 78b96c5a83 | |||
| 8a64b4efc2 | |||
| 9f6012b9ce | |||
| 7a944caf44 |
@@ -8,16 +8,17 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- python3 -m unittest
|
- python3 -m unittest
|
||||||
|
|
||||||
- name: build
|
- name: deploy
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: docker.dietrich-rink.de
|
registry: docker.dietrich-rink.de
|
||||||
repo: docker.dietrich-rink.de/drone-test
|
repo: docker.dietrich-rink.de/drone-test
|
||||||
auto_tag: true
|
auto_tag: true
|
||||||
|
force_tag: true
|
||||||
username:
|
username:
|
||||||
from_secret: registry_user
|
from_secret: docker_user
|
||||||
password:
|
password:
|
||||||
from_secret: registry_pass
|
from_secret: docker_pass
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY drone_test ./
|
COPY drone_test ./
|
||||||
|
|
||||||
CMD python -c "from drone_test import circle_area; print(circle_area(2)"
|
CMD python . 1 2
|
||||||
|
|||||||
9
drone_test/__main__.py
Normal file
9
drone_test/__main__.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
"""Python module to test drone builds"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from _circle_area import circle_area
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
print(circle_area(float(arg)))
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
"""Python module to test drone builds"""
|
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
class
|
||||||
|
|
||||||
def circle_area(radius: float):
|
def circle_area(radius: float):
|
||||||
"""Calculate the area of a circle
|
"""Calculate the area of a circle
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from drone_test import circle_area
|
from drone_test._circle_area import circle_area
|
||||||
|
|
||||||
class CircleAreaTest(TestCase):
|
class CircleAreaTest(TestCase):
|
||||||
def test_area_1(self):
|
def test_area_1(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user