mirror of
https://github.com/adferrand/docker-backuppc.git
synced 2023-11-05 04:40:26 +01:00
Merge branch 'azure-pipelines'
This commit is contained in:
commit
6d14e836ff
5
.azure-pipelines/main.yml
Normal file
5
.azure-pipelines/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- template: templates/integration-jobs.yml
|
17
.azure-pipelines/release.yml
Normal file
17
.azure-pipelines/release.yml
Normal file
@ -0,0 +1,17 @@
|
||||
trigger:
|
||||
branches:
|
||||
exclude:
|
||||
- "*"
|
||||
tags:
|
||||
include:
|
||||
- "4.*"
|
||||
|
||||
pr: none
|
||||
|
||||
stages:
|
||||
- stage: Build-And-Test
|
||||
jobs:
|
||||
- template: templates/integration-jobs.yml
|
||||
- stage: Release
|
||||
jobs:
|
||||
- template: templates/release-jobs.yml
|
48
.azure-pipelines/templates/integration-jobs.yml
Normal file
48
.azure-pipelines/templates/integration-jobs.yml
Normal file
@ -0,0 +1,48 @@
|
||||
jobs:
|
||||
- job: build
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
steps:
|
||||
- script: |
|
||||
docker pull adferrand/backuppc || true
|
||||
docker build --pull --cache-from adferrand/backuppc -t adferrand/backuppc .
|
||||
docker save adferrand/backuppc | gzip -c -1 > $(Build.ArtifactStagingDirectory)/docker-backuppc.tar.gz
|
||||
displayName: Build container
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
artifact: docker
|
||||
displayName: Store Docker artifact
|
||||
- job: unit-tests
|
||||
dependsOn: build
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: docker
|
||||
path: $(Build.SourcesDirectory)
|
||||
displayName: Retrieve Docker artifact
|
||||
- script: |
|
||||
docker load < docker-backuppc.tar.gz
|
||||
mkdir -p ./bin
|
||||
curl -fsSL https://goss.rocks/install | GOSS_DST=./bin sh
|
||||
GOSS_PATH=./bin/goss GOSS_SLEEP=2 GOSS_FILES_PATH=./tests ./bin/dgoss run adferrand/backuppc
|
||||
- job: integration-tests
|
||||
dependsOn: build
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: docker
|
||||
path: $(Build.SourcesDirectory)
|
||||
displayName: Retrieve Docker artifact
|
||||
- script: |
|
||||
docker load < docker-backuppc.tar.gz
|
||||
docker run --name backuppc-integration --detach -p 8080:8080 adferrand/backuppc
|
||||
sleep 5
|
||||
output=`curl http://backuppc:password@localhost:8080/BackupPC_Admin`
|
||||
echo "Expect the backupp configuration page without errors"
|
||||
grep "The servers PID is" <(echo $output)
|
||||
docker rm -f backuppc-integration
|
45
.azure-pipelines/templates/release-jobs.yml
Normal file
45
.azure-pipelines/templates/release-jobs.yml
Normal file
@ -0,0 +1,45 @@
|
||||
jobs:
|
||||
- job: docker
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: docker
|
||||
path: $(Build.SourcesDirectory)
|
||||
displayName: Retrieve Docker artifact
|
||||
- task: Docker@2
|
||||
inputs:
|
||||
command: login
|
||||
containerRegistry: docker-hub
|
||||
displayName: Login to DockerHub
|
||||
- script: |
|
||||
docker load < docker-backuppc.tar.gz
|
||||
VERSION=`cat VERSION`
|
||||
echo "Docker tag is: ${VERSION}"
|
||||
docker tag adferrand/backuppc adferrand/backuppc:4
|
||||
docker tag adferrand/backuppc "adferrand/backuppc:${VERSION}"
|
||||
displayName: Tag and push Docker images to DockerHub
|
||||
- job: github
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: 3.8
|
||||
addToPath: true
|
||||
displayName: Install Python
|
||||
- script: |
|
||||
VERSION=`cat VERSION`
|
||||
echo "Version is: $version"
|
||||
echo "##vso[task.setvariable variable=ReleaseVersion;]${VERSION}"
|
||||
displayVersion: Get version
|
||||
- script: |
|
||||
python utils/extract_changelog.py $(ReleaseVersion) > release_$(ReleaseVersion).md
|
||||
- task: GithubRelease@0
|
||||
inputs:
|
||||
gitHubConnection: github.com_adferrand
|
||||
title: Docker BackupPC $(ReleaseVersion)
|
||||
releaseNotesFile: $(Build.SourcesDirectory)/release_$(ReleaseVersion).md
|
||||
addChangeLog: false
|
||||
displayName: Create GitHub Release
|
90
CHANGELOG.md
90
CHANGELOG.md
@ -1,16 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## master - CURRENT
|
||||
|
||||
## [4.4.2 - 13/08/2020]
|
||||
## 4.4.0-2 - 13/08/2020
|
||||
# Modified
|
||||
* Fixed an error about docker instance failing to restart after first run (thanks @tadr0 and @csibbitt with #40)
|
||||
|
||||
## [4.4.1 - 24/07/2020]
|
||||
## 4.4.0-1 - 24/07/2020
|
||||
# Modified
|
||||
* Conditionnally create the symlink /bin/bzip2 to prevent regressions
|
||||
|
||||
## [4.4.0 - 21/06/2020]
|
||||
## 4.4.0 - 21/06/2020
|
||||
# Added
|
||||
* Add JSON::RS perl dependency to allow BackupPC metrics in JSON format
|
||||
* Update documentation about metrics
|
||||
@ -20,53 +20,53 @@
|
||||
* Update perl lib BackupPC::XS to 0.62
|
||||
* Update rsync-bpc to 3.1.2.2
|
||||
|
||||
## [4.3.2-6 - 01/06/2020]
|
||||
## 4.3.2-6 - 01/06/2020
|
||||
### Changed
|
||||
* Update base docker to Alpine 3.12
|
||||
* Update perl lib BackupPC::XS to 0.60
|
||||
|
||||
## [4.3.2-5 - 12/04/2020]
|
||||
## 4.3.2-5 - 12/04/2020
|
||||
### Added
|
||||
* Introduce the Active Directory / LDAP authentication for the BackupPC Web UI. Authentication method
|
||||
is controlled with the `AUTHENTICATION_METHOD` environment variable, that can be `file` or `ldap`
|
||||
(@christianuhlmann #23).
|
||||
|
||||
## [4.3.2-4 - 01/03/2020]
|
||||
## 4.3.2-4 - 01/03/2020
|
||||
### Added
|
||||
* Store mails generated by backuppc in /var/log/msmtp.log, and to supervisor stdout
|
||||
|
||||
### Changed
|
||||
* Do not override `EMailFromUserName` parameter in BackupPC when `SMTP_MAIL_DOMAIN` is not set
|
||||
|
||||
## [4.3.2-3 - 01/03/2020]
|
||||
## 4.3.2-3 - 01/03/2020
|
||||
### Added
|
||||
* Provide GNU tar
|
||||
|
||||
### Removed
|
||||
* Remove BusyBox tar
|
||||
|
||||
## [4.3.2-2 - 01/03/2020]
|
||||
## 4.3.2-2 - 01/03/2020
|
||||
### Changed
|
||||
* Switch from circus to supervisor to handle the container processes
|
||||
* Install par2cmdline from Alpine packages
|
||||
* Clean build dependencies
|
||||
* Align tests
|
||||
|
||||
## [4.3.2-1 - 24/02/2020]
|
||||
## 4.3.2-1 - 24/02/2020
|
||||
### Changed
|
||||
* Fallback to circus 0.15.0 since 0.16.x is consuming 100% of a CPU in current environment
|
||||
|
||||
## [4.3.2] - 18/02/2020
|
||||
## 4.3.2 - 18/02/2020
|
||||
### Changed
|
||||
* Update to BackupPC 4.3.2
|
||||
* Update base image to Alpine 3.11.3
|
||||
* Update Par2Cmdline to 0.8.1
|
||||
|
||||
## [4.3.1-1] - 07/12/2019
|
||||
## 4.3.1-1 - 07/12/2019
|
||||
### Changed
|
||||
* Update base image to Alpine 3.10.3
|
||||
|
||||
## [4.3.1] - 17/07/2019
|
||||
## 4.3.1 - 17/07/2019
|
||||
### Added
|
||||
* Proper Docker signal handling (eg. SIGINT) by making Circus be the PID 1
|
||||
* Support TLS in msmtp (thanks to @belaytzev in adferrand/docker-backuppc#22)
|
||||
@ -76,19 +76,19 @@
|
||||
* Update to rsync-bpc 3.1.2.1
|
||||
* Update perl lib BackupPC::XS to 0.59
|
||||
|
||||
## [4.3.0-6] - 18/03/2019
|
||||
## 4.3.0-6 - 18/03/2019
|
||||
### Added
|
||||
* Install DejaVu font for a better look and readability of generated RRD graphs in BackupPC UI (#21 from @jkroepke)
|
||||
|
||||
## [4.3.0-5] - 10/03/2019
|
||||
## 4.3.0-5 - 10/03/2019
|
||||
### Changed
|
||||
* Use a passphrase of 4 characters (instead of 1) when generating self-signed certificates (`USE_SSL=true`) to be accepted by newest versions of OpenSSL.
|
||||
|
||||
## [4.3.0-4] - 09/03/2019
|
||||
## 4.3.0-4 - 09/03/2019
|
||||
### Changed
|
||||
* Update Alpine base image to 3.9
|
||||
|
||||
## [4.3.0-3] - 06/12/2018
|
||||
## 4.3.0-3 - 06/12/2018
|
||||
### Added
|
||||
* Hostname in BackupPC instance is now in sync with the container hostname, and can be set using `--hostname` at container start (#12 @Alveel)
|
||||
* Add basic integration tests during the CI
|
||||
@ -97,33 +97,33 @@
|
||||
* Update perl lib BackupPC::XS to 0.58
|
||||
* Update rsync-bpc to 3.1.2.0
|
||||
|
||||
## [4.3.0-2] - 27/11/2018
|
||||
## 4.3.0-2 - 27/11/2018
|
||||
### Changed
|
||||
* Bugfix: fallback to rsync-bpc to 3.0.9.12 and BackupPC::XS 0.57 because upstream is broken
|
||||
* Versions 4.3.0-1 and 4.3.0 are also patched with this bugfix
|
||||
|
||||
## [4.3.0-1] - 26/11/2018
|
||||
## 4.3.0-1 - 26/11/2018
|
||||
### Added
|
||||
* Allow to use a pre-existing `server.pem` file mounted into the container to serve the BackupPC UI over https
|
||||
|
||||
## [4.3.0] - 26/11/2018
|
||||
## 4.3.0 - 26/11/2018
|
||||
### Changed
|
||||
* Update BackupPC to 4.2.0
|
||||
* Update perl lib BackupPC::XS to 0.58
|
||||
* Update rsync-bpc to 3.0.9.13
|
||||
|
||||
## [4.2.1-3] - 26/11/2018
|
||||
## 4.2.1-3 - 26/11/2018
|
||||
### Added
|
||||
* Add support for ACL to rsync-bpc (from @JoelLinn in #9)
|
||||
|
||||
## [4.2.1-2] - 09/10/2018
|
||||
## 4.2.1-2 - 09/10/2018
|
||||
### Added
|
||||
* Set up a complete CI/CD system for this Docker, using CircleCI: docker is now automatically packaged, tested and deployed to Docker Hub
|
||||
|
||||
### Changed
|
||||
* Hotfix for BZIP2 binary, due to latest Alpine layout modifications, is now applied when the container is created, removing the error `n: /bin/bzip2: File exists` when container is restarted.
|
||||
|
||||
## [4.2.1-1] - 12/09/2018
|
||||
## 4.2.1-1 - 12/09/2018
|
||||
### Added
|
||||
* Add and configure circus, an alternative to supervisor, compatible with Python 3, with better control over environment variables propagation, and network sockets supervision (not used yet here)
|
||||
* Mandatory perl modules for Backuppc are now installed as pre-compiled binaries from Alpine repos
|
||||
@ -138,104 +138,104 @@
|
||||
* Remove supervisor and its configuration
|
||||
* Remove build logic used to compile the mandatory perl modules
|
||||
|
||||
## [4.2.1] - 14/05/2018
|
||||
## 4.2.1 - 14/05/2018
|
||||
### Changed
|
||||
* Update BackupPC to 4.2.1
|
||||
|
||||
## [4.2.0] - 22/04/2018
|
||||
## 4.2.0 - 22/04/2018
|
||||
### Changed
|
||||
* Update BackupPC to 4.2.0
|
||||
|
||||
## [4.1.5-2] - 02/02/2018
|
||||
## 4.1.5-2 - 02/02/2018
|
||||
### Changed
|
||||
* Update Alpine base image to 3.7
|
||||
* Update rsync-bpc to 3.0.9.12
|
||||
|
||||
## [4.1.5-1] - 28/12/2017
|
||||
## 4.1.5-1 - 28/12/2017
|
||||
### Changed
|
||||
* Update rsync-bpc to 3.0.9.11
|
||||
* Update par2cmdline to 0.8.0
|
||||
|
||||
## [4.1.5] - 04/12/2017
|
||||
## 4.1.5 - 04/12/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.5
|
||||
* Update perl lib BackupPC::XS to 0.57
|
||||
* Update rsync-bpc to 3.0.9.9
|
||||
|
||||
## [4.1.4] - 29/11/2017
|
||||
## 4.1.4 - 29/11/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.4
|
||||
|
||||
## [4.1.3-10] - 15/11/2017
|
||||
## 4.1.3-10 - 15/11/2017
|
||||
### Added
|
||||
* Extends possibilities of `BACKUPPC_UUID`/`BACKUPPC_GUID`: previously existing `UUID`/`GUID` (like 100) in container could not be reused without error. This version now handles it: any `UUID`/`GUID` can be used.
|
||||
* Extended supervisord logging capabilities over backuppc and lighttpd instances.
|
||||
|
||||
## [4.1.3-9] - 01/10/2017
|
||||
## 4.1.3-9 - 01/10/2017
|
||||
### Added
|
||||
* Add missing runtime libraries mandatory for par2
|
||||
|
||||
### Changed
|
||||
* Update par2cmdline to 0.7.4
|
||||
|
||||
## [4.1.3-8] - 02/09/2017
|
||||
## 4.1.3-8 - 02/09/2017
|
||||
### Changed
|
||||
* TimeZone: fix inverted check of TZ, from PR #5 of @merikz
|
||||
|
||||
## [4.1.3-7] - 13/08/2017
|
||||
## 4.1.3-7 - 13/08/2017
|
||||
### Changed
|
||||
* Correct MIME types provided by the lighttpd server (issue #4 by @vb4life)
|
||||
* Update par2cmdline to 0.7.3
|
||||
|
||||
## [4.1.3-6] - 02/08/2017
|
||||
## 4.1.3-6 - 02/08/2017
|
||||
### Changed
|
||||
* Add env variable driven timezone
|
||||
|
||||
## [4.1.3-5] - 23/07/2017
|
||||
## 4.1.3-5 - 23/07/2017
|
||||
### Changed
|
||||
* Disabling strict hostkey checking. As per the comment this should be the intended behavior.
|
||||
|
||||
## [4.1.3-4] - 26/06/2017
|
||||
## 4.1.3-4 - 26/06/2017
|
||||
### Added
|
||||
* Persist log dirs files in /data/backuppc
|
||||
|
||||
## [4.1.3-3] - 12/06/2017
|
||||
## 4.1.3-3 - 12/06/2017
|
||||
### Changed
|
||||
* Update perl lib BackupPC::XS to 0.56
|
||||
* Update rsync-bpc to 3.0.9.8
|
||||
|
||||
## [4.1.3-2] - 08/06/2017
|
||||
## 4.1.3-2 - 08/06/2017
|
||||
### Added
|
||||
* Persist htpasswd config for admin access
|
||||
|
||||
## [4.1.3-1] - 07/06/2017
|
||||
## 4.1.3-1 - 07/06/2017
|
||||
### Changed
|
||||
* Update Alpine base image to 3.6
|
||||
|
||||
## [4.1.3] - 06/06/2017
|
||||
## 4.1.3 - 06/06/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.3
|
||||
* Update perl lib BackupPC::XS to 0.55
|
||||
* Update par2cmdline to 0.7.2
|
||||
|
||||
## [4.1.2-1] - 26/05/2017
|
||||
## 4.1.2-1 - 26/05/2017
|
||||
### Changed
|
||||
* Update perl lib BackupPC::XS to 0.54
|
||||
* Update rsync-bpc to 3.0.9.7
|
||||
* Disable strict host key checking
|
||||
|
||||
## [4.1.2] - 21/05/2017
|
||||
## 4.1.2 - 21/05/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.2
|
||||
|
||||
## [4.1.1] - 22/04/2017
|
||||
## 4.1.1 - 22/04/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.1
|
||||
|
||||
## [4.1.0] - 22/04/2017
|
||||
## 4.1.0 - 22/04/2017
|
||||
### Changed
|
||||
* Update BackupPC to 4.1.0
|
||||
|
||||
## [4.0.0] - 22/04/2017
|
||||
## 4.0.0 - 22/04/2017
|
||||
### Added
|
||||
* Create this docker and its core principles.
|
@ -1,5 +1,5 @@
|
||||
# ![](https://raw.githubusercontent.com/adferrand/docker-backuppc/master/images/logo_200px.png) adferrand/backuppc
|
||||
![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://images.microbadger.com/badges/version/adferrand/backuppc:4.4.0-2.svg) ![](https://images.microbadger.com/badges/image/adferrand/backuppc:4.4.0-2.svg)](https://microbadger.com/images/adferrand/backuppc:4.4.0-2) [![CircleCI](https://circleci.com/gh/adferrand/docker-backuppc/tree/master.svg?style=shield)](https://circleci.com/gh/adferrand/docker-backuppc/tree/master)
|
||||
![](https://img.shields.io/badge/tags-4%20latest-lightgrey.svg) [![](https://img.shields.io/github/v/release/adferrand/docker-backuppc) ![](https://images.microbadger.com/badges/image/adferrand/backuppc.svg)](https://microbadger.com/images/adferrand/backuppc) [![CircleCI](https://circleci.com/gh/adferrand/docker-backuppc/tree/master.svg?style=shield)](https://circleci.com/gh/adferrand/docker-backuppc/tree/master)
|
||||
|
||||
* [Container functionalities](#container-functionalities)
|
||||
* [About BackupPC](#about-backuppc)
|
||||
|
68
utils/create_release.py
Normal file
68
utils/create_release.py
Normal file
@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
import datetime
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
|
||||
def main():
|
||||
git_clean = subprocess.check_output(
|
||||
"git status --porcelain", shell=True, universal_newlines=True,
|
||||
).strip()
|
||||
if git_clean:
|
||||
raise RuntimeError("Error, git workspace is not clean: \n{0}".format(git_clean))
|
||||
|
||||
with open(os.path.join(PROJECT_ROOT, "VERSION")) as file_h:
|
||||
current_version = file_h.read().strip()
|
||||
|
||||
print("Current version is: {0}".format(current_version))
|
||||
print("Please insert new version:")
|
||||
new_version = str(input())
|
||||
|
||||
if StrictVersion(new_version) <= StrictVersion(current_version):
|
||||
raise RuntimeError(
|
||||
"Error new version is below current version: {0} < {1}".format(
|
||||
new_version, current_version
|
||||
)
|
||||
)
|
||||
|
||||
try:
|
||||
with open(os.path.join(PROJECT_ROOT, "CHANGELOG.md")) as file_h:
|
||||
changelog = file_h.read()
|
||||
|
||||
today = datetime.datetime.today()
|
||||
changelog = changelog.replace(
|
||||
"## master - CURRENT\n",
|
||||
"""\
|
||||
## master - CURRENT
|
||||
## {0} - {1}
|
||||
""".format(
|
||||
new_version, today.strftime("%d/%m/%Y")
|
||||
),
|
||||
)
|
||||
|
||||
with open(os.path.join(PROJECT_ROOT, "CHANGELOG.md"), "w") as file_h:
|
||||
file_h.write(changelog)
|
||||
|
||||
with open(os.path.join(PROJECT_ROOT, "VERSION"), "w") as file_h:
|
||||
file_h.write(new_version)
|
||||
|
||||
subprocess.check_call(
|
||||
'git commit -a -m "Version {0}"'.format(new_version), shell=True
|
||||
)
|
||||
subprocess.check_call("git tag v{0}".format(new_version), shell=True)
|
||||
subprocess.check_call("git push --tags", shell=True)
|
||||
subprocess.check_call("git push", shell=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("Error detected, cleaning state.")
|
||||
subprocess.call("git tag -d v{0}".format(new_version), shell=True)
|
||||
subprocess.check_call("git reset --hard", shell=True)
|
||||
raise e
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
46
utils/extract_changelog.py
Normal file
46
utils/extract_changelog.py
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
NEW_SECTION_PATTERN = re.compile(r"^\s*##\s*[\d.-]+\s*-\s*[\d/]+\s*$")
|
||||
|
||||
|
||||
def main():
|
||||
version = sys.argv[1]
|
||||
|
||||
if version == "latest":
|
||||
section_pattern = NEW_SECTION_PATTERN
|
||||
else:
|
||||
section_pattern = re.compile(
|
||||
r"^\s*##\s*{0}\s*-\s*[\d/]+\s*$".format(version.replace(".", "\\."))
|
||||
)
|
||||
|
||||
with open(os.path.join(ROOT, "CHANGELOG.md")) as file_h:
|
||||
lines = file_h.read().splitlines()
|
||||
|
||||
changelog = []
|
||||
|
||||
i = 0
|
||||
while i < len(lines):
|
||||
if section_pattern.match(lines[i]):
|
||||
i = i + 1
|
||||
while i < len(lines):
|
||||
if NEW_SECTION_PATTERN.match(lines[i]):
|
||||
break
|
||||
changelog.append(lines[i])
|
||||
i = i + 1
|
||||
break
|
||||
i = i + 1
|
||||
|
||||
changelog = [entry for entry in changelog if entry]
|
||||
|
||||
print("\n".join(changelog))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in New Issue
Block a user