Skip to content

Commit d8f6989

Browse files
Merge pull request #208 from pyouroboros/develop
v1.2.0 Merge
2 parents 27b7ba2 + 210081c commit d8f6989

14 files changed

+522
-263
lines changed

.travis.yml

-31
This file was deleted.

CHANGELOG.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
## [1.2.0](https://github.com/pyouroboros/ouroboros/tree/1.2.0) (2019-02-13)
4+
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/1.1.2...1.2.0)
5+
6+
**Implemented enhancements:**
7+
8+
- Move "Interval container update" messages to debug log level [\#194](https://github.com/pyouroboros/ouroboros/issues/194)
9+
- \[Feature Request\] Support for Swarm Services [\#178](https://github.com/pyouroboros/ouroboros/issues/178)
10+
- Add Warning for label\_enable not set while using labels\_only [\#202](https://github.com/pyouroboros/ouroboros/pull/202) ([larsderidder](https://github.com/larsderidder))
11+
12+
**Fixed bugs:**
13+
14+
- Change depends\_on logic [\#198](https://github.com/pyouroboros/ouroboros/issues/198)
15+
- Containers relying upon network namespace of a container that gets updated breaks when the parent container is recreated [\#197](https://github.com/pyouroboros/ouroboros/issues/197)
16+
- Exception when trying to update container with complex compose networks [\#196](https://github.com/pyouroboros/ouroboros/issues/196)
17+
- Problem with network IPv4 address carry-over [\#193](https://github.com/pyouroboros/ouroboros/issues/193)
18+
- Monitor Ignored Re-Address + jenkins cleanup [\#191](https://github.com/pyouroboros/ouroboros/pull/191) [[cleanup](https://github.com/pyouroboros/ouroboros/labels/cleanup)] ([DirtyCajunRice](https://github.com/DirtyCajunRice))
19+
20+
**Closed issues:**
21+
22+
- Remove legacy --latest [\#206](https://github.com/pyouroboros/ouroboros/issues/206) [[breaking change](https://github.com/pyouroboros/ouroboros/labels/breaking%20change)] [[cleanup](https://github.com/pyouroboros/ouroboros/labels/cleanup)]
23+
- Add environment variables in Wiki [\#203](https://github.com/pyouroboros/ouroboros/issues/203) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)]
24+
- Slack notifications via webhook not working [\#187](https://github.com/pyouroboros/ouroboros/issues/187)
25+
26+
**Other Pull Requests**
27+
28+
- v1.2.0 Merge [\#208](https://github.com/pyouroboros/ouroboros/pull/208) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
29+
- v1.2.0 to develop [\#207](https://github.com/pyouroboros/ouroboros/pull/207) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
30+
- Patch/tag bug [\#205](https://github.com/pyouroboros/ouroboros/pull/205) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
31+
- Patch/group 5 [\#201](https://github.com/pyouroboros/ouroboros/pull/201) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
32+
- Fix bug in user defined network detection [\#200](https://github.com/pyouroboros/ouroboros/pull/200) ([nightvisi0n](https://github.com/nightvisi0n))
33+
- Adjust apscheduler logger [\#199](https://github.com/pyouroboros/ouroboros/pull/199) ([circa10a](https://github.com/circa10a))
34+
- Carry over network config [\#195](https://github.com/pyouroboros/ouroboros/pull/195) ([nightvisi0n](https://github.com/nightvisi0n))
35+
- Jenkins tweaks [\#192](https://github.com/pyouroboros/ouroboros/pull/192) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
36+
- Swarm + Jenkins [\#188](https://github.com/pyouroboros/ouroboros/pull/188) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
37+
338
## [1.1.2](https://github.com/pyouroboros/ouroboros/tree/1.1.2) (2019-02-02)
439
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/1.1.1...1.1.2)
540

@@ -11,8 +46,11 @@
1146

1247
- cron documentation example update [\#182](https://github.com/pyouroboros/ouroboros/issues/182) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)]
1348

14-
***Other Pull Requests**
15-
- v1.1.2 Merge [\#185](https://github.com/pyouroboros/ouroboros/pull/185) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
49+
**Other Pull Requests**
50+
51+
- v1.1.2 Merge [\#186](https://github.com/pyouroboros/ouroboros/pull/186) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
52+
- v1.1.2 to develop [\#183](https://github.com/pyouroboros/ouroboros/pull/183) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
53+
- Fix default timezone [\#177](https://github.com/pyouroboros/ouroboros/pull/177) ([circa10a](https://github.com/circa10a))
1654

1755
## [1.1.1](https://github.com/pyouroboros/ouroboros/tree/1.1.1) (2019-02-01)
1856
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/1.1.0...1.1.1)

Dockerfile.arm

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ENV TZ UTC
66

77
WORKDIR /app
88

9-
COPY /qemu-arm-static /usr/bin/qemu-arm-static
10-
119
COPY /requirements.txt /setup.py /ouroboros /README.md /app/
1210

1311
COPY /pyouroboros /app/pyouroboros

Dockerfile.arm64

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ENV TZ UTC
66

77
WORKDIR /app
88

9-
COPY /qemu-aarch64-static /usr/bin/qemu-aarch64-static
10-
119
COPY /requirements.txt /setup.py /ouroboros /README.md /app/
1210

1311
COPY /pyouroboros /app/pyouroboros

Jenkinsfile

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
pipeline {
2+
agent none
3+
environment {
4+
DOCKER_REPO = "pyouroboros/ouroboros"
5+
GIT_REPO = 'pyouroboros/ouroboros'
6+
VERSION_FILE = "pyouroboros/__init__.py"
7+
FLAKE_FILES = "ouroboros *.py pyouroboros/*.py"
8+
TAG = ""
9+
GIT_TOKEN = credentials('github-jenkins-token')
10+
PYPI_CREDS = credentials('pypi-creds-dirtycajunrice')
11+
}
12+
stages {
13+
stage('Flake8 + Run Once') {
14+
agent { label 'amd64'}
15+
steps {
16+
sh """
17+
python3 -m venv venv && venv/bin/pip install flake8 && venv/bin/python -m flake8 --max-line-length 120 ${FLAKE_FILES}
18+
venv/bin/python -m pip install -r requirements.txt && venv/bin/python ouroboros --log-level debug --run-once
19+
rm -rf venv/
20+
"""
21+
script {
22+
TAG = sh(returnStdout: true, script: 'grep -i version ${VERSION_FILE} | cut -d" " -f3 | tr -d \\"').trim()
23+
}
24+
}
25+
}
26+
stage('Docker Builds') {
27+
when {
28+
anyOf {
29+
branch 'master'
30+
branch 'develop'
31+
}
32+
}
33+
parallel {
34+
stage('amd64') {
35+
agent { label 'amd64'}
36+
steps {
37+
script {
38+
if (BRANCH_NAME == 'master') {
39+
def image = docker.build("${DOCKER_REPO}:${TAG}-amd64")
40+
image.push()
41+
42+
} else if (BRANCH_NAME == 'develop') {
43+
def image = docker.build("${DOCKER_REPO}:develop-amd64")
44+
image.push()
45+
}
46+
}
47+
}
48+
}
49+
stage('ARMv6') {
50+
agent { label 'arm64'}
51+
steps {
52+
script {
53+
if (BRANCH_NAME == 'master') {
54+
def image = docker.build("${DOCKER_REPO}:${TAG}-arm", "-f Dockerfile.arm .")
55+
image.push()
56+
} else if (BRANCH_NAME == 'develop') {
57+
def image = docker.build("${DOCKER_REPO}:develop-arm", "-f Dockerfile.arm .")
58+
image.push()
59+
}
60+
}
61+
}
62+
}
63+
stage('ARM64v8') {
64+
agent { label 'arm64'}
65+
steps {
66+
script {
67+
if (BRANCH_NAME == 'master') {
68+
def image = docker.build("${DOCKER_REPO}:${TAG}-arm64", "-f Dockerfile.arm64 .")
69+
image.push()
70+
} else if (BRANCH_NAME == 'develop') {
71+
def image = docker.build("${DOCKER_REPO}:develop-arm64", "-f Dockerfile.arm64 .")
72+
image.push()
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
stage('Releases') {
80+
when {
81+
anyOf {
82+
branch 'master'
83+
branch 'develop'
84+
}
85+
}
86+
parallel {
87+
stage('Docker Manifest') {
88+
agent { label 'amd64'}
89+
steps {
90+
script {
91+
if (BRANCH_NAME == 'master') {
92+
sh(script: """
93+
docker manifest create ${DOCKER_REPO}:${TAG} ${DOCKER_REPO}:${TAG}-amd64 ${DOCKER_REPO}:${TAG}-arm64 ${DOCKER_REPO}:${TAG}-arm
94+
docker manifest inspect ${DOCKER_REPO}:${TAG}
95+
docker manifest push -p ${DOCKER_REPO}:${TAG}
96+
docker manifest create ${DOCKER_REPO}:latest ${DOCKER_REPO}:${TAG}-amd64 ${DOCKER_REPO}:${TAG}-arm64 ${DOCKER_REPO}:${TAG}-arm
97+
docker manifest inspect ${DOCKER_REPO}:latest
98+
docker manifest push -p ${DOCKER_REPO}:latest
99+
"""
100+
)
101+
} else if (BRANCH_NAME == 'develop') {
102+
sh(script: """
103+
docker manifest create ${DOCKER_REPO}:develop ${DOCKER_REPO}:develop-amd64 ${DOCKER_REPO}:develop-arm64 ${DOCKER_REPO}:develop-arm
104+
docker manifest inspect ${DOCKER_REPO}:develop
105+
docker manifest push -p ${DOCKER_REPO}:develop
106+
"""
107+
)
108+
}
109+
}
110+
}
111+
}
112+
stage('GitHub') {
113+
when { branch 'master' }
114+
agent { label 'amd64'}
115+
steps {
116+
sh """
117+
git remote set-url origin "https://${GIT_TOKEN_USR}:${GIT_TOKEN_PSW}@github.com/${GIT_REPO}.git"
118+
git tag ${TAG}
119+
git push --tags
120+
"""
121+
}
122+
}
123+
stage('PyPi') {
124+
when { branch 'master' }
125+
agent { label 'amd64'}
126+
steps {
127+
sh """
128+
python3 -m venv venv && venv/bin/pip install twine
129+
venv/bin/python setup.py sdist && venv/bin/python -m twine --skip-existing -u ${PYPI_CREDS_USR} -p ${PYPI_CREDS_PSW} upload dist/*
130+
git tag ${TAG}
131+
git push --tags
132+
"""
133+
}
134+
}
135+
}
136+
}
137+
}
138+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Discord](https://img.shields.io/discord/532695326117593112.svg?colorB=7289DA&label=Discord&logo=Discord&logoColor=7289DA&style=flat-square)](https://discord.gg/qHNByUW)
44
[![BuyUsCoffee](https://img.shields.io/badge/BuyMeACoffee-Donate-ff813f.svg?logo=CoffeeScript&style=flat-square)](https://buymeacoff.ee/ouroboros)
5-
[![Travis](https://img.shields.io/travis/pyouroboros/ouroboros/master.svg?style=flat-square)](https://travis-ci.org/pyouroboros/ouroboros)
5+
[![Build Status](https://jenkins.cajun.pro/buildStatus/icon?job=Ouroboros/master)](https://jenkins.cajun.pro/job/Ouroboros/job/master/)
66
[![Release](https://img.shields.io/github/release/pyouroboros/ouroboros.svg?style=flat-square)](https://hub.docker.com/r/pyouroboros/ouroboros/)
77
[![Pypi Downloads](https://img.shields.io/pypi/dm/ouroboros-cli.svg?style=flat-square)](https://pypi.org/project/ouroboros-cli/)
88
[![Python Version](https://img.shields.io/pypi/pyversions/ouroboros-cli.svg?style=flat-square)](https://pypi.org/project/ouroboros-cli/)

deploy.sh

-79
This file was deleted.

prebuild.sh

-3
This file was deleted.

pyouroboros/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION = "1.1.2"
1+
VERSION = "1.2.0"
22
BRANCH = "master"

pyouroboros/config.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
class Config(object):
77
options = ['INTERVAL', 'PROMETHEUS', 'DOCKER_SOCKETS', 'MONITOR', 'IGNORE', 'LOG_LEVEL', 'PROMETHEUS_ADDR',
8-
'PROMETHEUS_PORT', 'NOTIFIERS', 'REPO_USER', 'REPO_PASS', 'CLEANUP', 'RUN_ONCE', 'LATEST', 'CRON',
8+
'PROMETHEUS_PORT', 'NOTIFIERS', 'REPO_USER', 'REPO_PASS', 'CLEANUP', 'RUN_ONCE', 'CRON',
99
'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE', 'INFLUX_SSL',
1010
'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS', 'LABELS_ONLY',
11-
'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY']
11+
'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY', 'SWARM']
1212

1313
hostname = environ.get('HOSTNAME')
1414
interval = 300
1515
cron = None
1616
docker_sockets = 'unix://var/run/docker.sock'
1717
docker_tls = False
1818
docker_tls_verify = True
19+
swarm = False
1920
monitor = []
2021
ignore = []
2122
data_export = None
2223
log_level = 'info'
23-
latest = False
2424
cleanup = False
2525
run_once = False
2626
dry_run = False
@@ -90,7 +90,7 @@ def parse(self):
9090
setattr(self, option.lower(), opt)
9191
except ValueError as e:
9292
print(e)
93-
elif option in ['LATEST', 'CLEANUP', 'RUN_ONCE', 'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DRY_RUN',
93+
elif option in ['CLEANUP', 'RUN_ONCE', 'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DRY_RUN', 'SWARM',
9494
'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS', 'LABELS_ONLY', 'DOCKER_TLS_VERIFY']:
9595
if env_opt.lower() in ['true', 'yes']:
9696
setattr(self, option.lower(), True)
@@ -111,6 +111,9 @@ def parse(self):
111111
if self.interval < 30:
112112
self.interval = 30
113113

114+
if self.labels_only and not self.label_enable:
115+
self.logger.warning('labels_only enabled but not in use without label_enable')
116+
114117
for option in ['docker_sockets', 'notifiers', 'monitor', 'ignore']:
115118
if isinstance(getattr(self, option), str):
116119
string_list = getattr(self, option)

0 commit comments

Comments
 (0)