Skip to content

Commit

Permalink
Merge pull request #208 from pyouroboros/develop
Browse files Browse the repository at this point in the history
v1.2.0 Merge
  • Loading branch information
dirtycajunrice authored Feb 14, 2019
2 parents 27b7ba2 + 210081c commit d8f6989
Show file tree
Hide file tree
Showing 14 changed files with 522 additions and 263 deletions.
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

42 changes: 40 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Change Log

## [1.2.0](https://github.com/pyouroboros/ouroboros/tree/1.2.0) (2019-02-13)
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/1.1.2...1.2.0)

**Implemented enhancements:**

- Move "Interval container update" messages to debug log level [\#194](https://github.com/pyouroboros/ouroboros/issues/194)
- \[Feature Request\] Support for Swarm Services [\#178](https://github.com/pyouroboros/ouroboros/issues/178)
- Add Warning for label\_enable not set while using labels\_only [\#202](https://github.com/pyouroboros/ouroboros/pull/202) ([larsderidder](https://github.com/larsderidder))

**Fixed bugs:**

- Change depends\_on logic [\#198](https://github.com/pyouroboros/ouroboros/issues/198)
- 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)
- Exception when trying to update container with complex compose networks [\#196](https://github.com/pyouroboros/ouroboros/issues/196)
- Problem with network IPv4 address carry-over [\#193](https://github.com/pyouroboros/ouroboros/issues/193)
- 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))

**Closed issues:**

- 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)]
- Add environment variables in Wiki [\#203](https://github.com/pyouroboros/ouroboros/issues/203) [[documentation](https://github.com/pyouroboros/ouroboros/labels/documentation)]
- Slack notifications via webhook not working [\#187](https://github.com/pyouroboros/ouroboros/issues/187)

**Other Pull Requests**

- v1.2.0 Merge [\#208](https://github.com/pyouroboros/ouroboros/pull/208) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- v1.2.0 to develop [\#207](https://github.com/pyouroboros/ouroboros/pull/207) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Patch/tag bug [\#205](https://github.com/pyouroboros/ouroboros/pull/205) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Patch/group 5 [\#201](https://github.com/pyouroboros/ouroboros/pull/201) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Fix bug in user defined network detection [\#200](https://github.com/pyouroboros/ouroboros/pull/200) ([nightvisi0n](https://github.com/nightvisi0n))
- Adjust apscheduler logger [\#199](https://github.com/pyouroboros/ouroboros/pull/199) ([circa10a](https://github.com/circa10a))
- Carry over network config [\#195](https://github.com/pyouroboros/ouroboros/pull/195) ([nightvisi0n](https://github.com/nightvisi0n))
- Jenkins tweaks [\#192](https://github.com/pyouroboros/ouroboros/pull/192) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Swarm + Jenkins [\#188](https://github.com/pyouroboros/ouroboros/pull/188) ([DirtyCajunRice](https://github.com/DirtyCajunRice))

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

Expand All @@ -11,8 +46,11 @@

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

***Other Pull Requests**
- v1.1.2 Merge [\#185](https://github.com/pyouroboros/ouroboros/pull/185) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
**Other Pull Requests**

- v1.1.2 Merge [\#186](https://github.com/pyouroboros/ouroboros/pull/186) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- v1.1.2 to develop [\#183](https://github.com/pyouroboros/ouroboros/pull/183) ([DirtyCajunRice](https://github.com/DirtyCajunRice))
- Fix default timezone [\#177](https://github.com/pyouroboros/ouroboros/pull/177) ([circa10a](https://github.com/circa10a))

## [1.1.1](https://github.com/pyouroboros/ouroboros/tree/1.1.1) (2019-02-01)
[Full Changelog](https://github.com/pyouroboros/ouroboros/compare/1.1.0...1.1.1)
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ENV TZ UTC

WORKDIR /app

COPY /qemu-arm-static /usr/bin/qemu-arm-static

COPY /requirements.txt /setup.py /ouroboros /README.md /app/

COPY /pyouroboros /app/pyouroboros
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ENV TZ UTC

WORKDIR /app

COPY /qemu-aarch64-static /usr/bin/qemu-aarch64-static

COPY /requirements.txt /setup.py /ouroboros /README.md /app/

COPY /pyouroboros /app/pyouroboros
Expand Down
138 changes: 138 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
pipeline {
agent none
environment {
DOCKER_REPO = "pyouroboros/ouroboros"
GIT_REPO = 'pyouroboros/ouroboros'
VERSION_FILE = "pyouroboros/__init__.py"
FLAKE_FILES = "ouroboros *.py pyouroboros/*.py"
TAG = ""
GIT_TOKEN = credentials('github-jenkins-token')
PYPI_CREDS = credentials('pypi-creds-dirtycajunrice')
}
stages {
stage('Flake8 + Run Once') {
agent { label 'amd64'}
steps {
sh """
python3 -m venv venv && venv/bin/pip install flake8 && venv/bin/python -m flake8 --max-line-length 120 ${FLAKE_FILES}
venv/bin/python -m pip install -r requirements.txt && venv/bin/python ouroboros --log-level debug --run-once
rm -rf venv/
"""
script {
TAG = sh(returnStdout: true, script: 'grep -i version ${VERSION_FILE} | cut -d" " -f3 | tr -d \\"').trim()
}
}
}
stage('Docker Builds') {
when {
anyOf {
branch 'master'
branch 'develop'
}
}
parallel {
stage('amd64') {
agent { label 'amd64'}
steps {
script {
if (BRANCH_NAME == 'master') {
def image = docker.build("${DOCKER_REPO}:${TAG}-amd64")
image.push()

} else if (BRANCH_NAME == 'develop') {
def image = docker.build("${DOCKER_REPO}:develop-amd64")
image.push()
}
}
}
}
stage('ARMv6') {
agent { label 'arm64'}
steps {
script {
if (BRANCH_NAME == 'master') {
def image = docker.build("${DOCKER_REPO}:${TAG}-arm", "-f Dockerfile.arm .")
image.push()
} else if (BRANCH_NAME == 'develop') {
def image = docker.build("${DOCKER_REPO}:develop-arm", "-f Dockerfile.arm .")
image.push()
}
}
}
}
stage('ARM64v8') {
agent { label 'arm64'}
steps {
script {
if (BRANCH_NAME == 'master') {
def image = docker.build("${DOCKER_REPO}:${TAG}-arm64", "-f Dockerfile.arm64 .")
image.push()
} else if (BRANCH_NAME == 'develop') {
def image = docker.build("${DOCKER_REPO}:develop-arm64", "-f Dockerfile.arm64 .")
image.push()
}
}
}
}
}
}
stage('Releases') {
when {
anyOf {
branch 'master'
branch 'develop'
}
}
parallel {
stage('Docker Manifest') {
agent { label 'amd64'}
steps {
script {
if (BRANCH_NAME == 'master') {
sh(script: """
docker manifest create ${DOCKER_REPO}:${TAG} ${DOCKER_REPO}:${TAG}-amd64 ${DOCKER_REPO}:${TAG}-arm64 ${DOCKER_REPO}:${TAG}-arm
docker manifest inspect ${DOCKER_REPO}:${TAG}
docker manifest push -p ${DOCKER_REPO}:${TAG}
docker manifest create ${DOCKER_REPO}:latest ${DOCKER_REPO}:${TAG}-amd64 ${DOCKER_REPO}:${TAG}-arm64 ${DOCKER_REPO}:${TAG}-arm
docker manifest inspect ${DOCKER_REPO}:latest
docker manifest push -p ${DOCKER_REPO}:latest
"""
)
} else if (BRANCH_NAME == 'develop') {
sh(script: """
docker manifest create ${DOCKER_REPO}:develop ${DOCKER_REPO}:develop-amd64 ${DOCKER_REPO}:develop-arm64 ${DOCKER_REPO}:develop-arm
docker manifest inspect ${DOCKER_REPO}:develop
docker manifest push -p ${DOCKER_REPO}:develop
"""
)
}
}
}
}
stage('GitHub') {
when { branch 'master' }
agent { label 'amd64'}
steps {
sh """
git remote set-url origin "https://${GIT_TOKEN_USR}:${GIT_TOKEN_PSW}@github.com/${GIT_REPO}.git"
git tag ${TAG}
git push --tags
"""
}
}
stage('PyPi') {
when { branch 'master' }
agent { label 'amd64'}
steps {
sh """
python3 -m venv venv && venv/bin/pip install twine
venv/bin/python setup.py sdist && venv/bin/python -m twine --skip-existing -u ${PYPI_CREDS_USR} -p ${PYPI_CREDS_PSW} upload dist/*
git tag ${TAG}
git push --tags
"""
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

This file was deleted.

3 changes: 0 additions & 3 deletions prebuild.sh

This file was deleted.

2 changes: 1 addition & 1 deletion pyouroboros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "1.1.2"
VERSION = "1.2.0"
BRANCH = "master"
11 changes: 7 additions & 4 deletions pyouroboros/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

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

hostname = environ.get('HOSTNAME')
interval = 300
cron = None
docker_sockets = 'unix://var/run/docker.sock'
docker_tls = False
docker_tls_verify = True
swarm = False
monitor = []
ignore = []
data_export = None
log_level = 'info'
latest = False
cleanup = False
run_once = False
dry_run = False
Expand Down Expand Up @@ -90,7 +90,7 @@ def parse(self):
setattr(self, option.lower(), opt)
except ValueError as e:
print(e)
elif option in ['LATEST', 'CLEANUP', 'RUN_ONCE', 'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DRY_RUN',
elif option in ['CLEANUP', 'RUN_ONCE', 'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DRY_RUN', 'SWARM',
'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS', 'LABELS_ONLY', 'DOCKER_TLS_VERIFY']:
if env_opt.lower() in ['true', 'yes']:
setattr(self, option.lower(), True)
Expand All @@ -111,6 +111,9 @@ def parse(self):
if self.interval < 30:
self.interval = 30

if self.labels_only and not self.label_enable:
self.logger.warning('labels_only enabled but not in use without label_enable')

for option in ['docker_sockets', 'notifiers', 'monitor', 'ignore']:
if isinstance(getattr(self, option), str):
string_list = getattr(self, option)
Expand Down
Loading

0 comments on commit d8f6989

Please sign in to comment.