Compare commits
2 Commits
version/0.
...
version/0.
Author | SHA1 | Date | |
---|---|---|---|
6649eb401e | |||
b657d7319d |
@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 0.0.5-alpha
|
||||
current_version = 0.0.6-alpha
|
||||
tag = True
|
||||
commit = True
|
||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\-(?P<release>.*)
|
||||
|
@ -46,7 +46,7 @@ package-docker:
|
||||
before_script:
|
||||
- echo "{\"auths\":{\"https://docker.$NEXUS_URL/\":{\"username\":\"$NEXUS_USER\",\"password\":\"$NEXUS_PASS\"}}}" > /kaniko/.docker/config.json
|
||||
script:
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination docker.pkg.beryju.org/passbook:latest --destination docker.pkg.beryju.org/passbook:0.0.5-alpha
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination docker.pkg.beryju.org/passbook:latest --destination docker.pkg.beryju.org/passbook:0.0.6-alpha
|
||||
stage: build
|
||||
only:
|
||||
- tags
|
||||
|
@ -4,7 +4,7 @@ COPY ./passbook/ /app/passbook
|
||||
COPY ./manage.py /app/
|
||||
COPY ./requirements.txt /app/
|
||||
|
||||
WORKDIR /source/
|
||||
WORKDIR /app/
|
||||
|
||||
RUN mkdir /app/static/ && \
|
||||
pip install -r requirements.txt && \
|
||||
@ -12,7 +12,6 @@ RUN mkdir /app/static/ && \
|
||||
./manage.py collectstatic --no-input
|
||||
|
||||
FROM python:3.6-slim-stretch
|
||||
# LABEL version="1.8.8"
|
||||
|
||||
COPY ./passbook/ /app/passbook
|
||||
COPY ./manage.py /app/
|
||||
@ -21,7 +20,6 @@ COPY --from=build /app/static/* /app/static/
|
||||
|
||||
WORKDIR /app/
|
||||
|
||||
#RUN apk add --no-cache libffi-dev build-base py2-pip python2-dev libxml-dev && \
|
||||
RUN pip install -r requirements.txt && \
|
||||
pip install psycopg2 && \
|
||||
adduser --system --home /app/ passbook && \
|
||||
|
@ -1,5 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: "0.0.5-alpha"
|
||||
appVersion: "0.0.6-alpha"
|
||||
description: A Helm chart for passbook.
|
||||
name: passbook
|
||||
version: 1.0.0
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook admin"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook api"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook audit Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook captcha_factor Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook core"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
71
passbook/core/management/commands/nexus_upload.py
Normal file
71
passbook/core/management/commands/nexus_upload.py
Normal file
@ -0,0 +1,71 @@
|
||||
"""passbook nexus_upload management command"""
|
||||
from getpass import getpass
|
||||
|
||||
import requests
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Upload debian package to nexus repository"""
|
||||
|
||||
url = None
|
||||
user = None
|
||||
password = None
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'--repo',
|
||||
action='store',
|
||||
help='Repository to upload to',
|
||||
required=True)
|
||||
parser.add_argument(
|
||||
'--url',
|
||||
action='store',
|
||||
help='Nexus root URL',
|
||||
required=True)
|
||||
parser.add_argument(
|
||||
'--user',
|
||||
action='store',
|
||||
help='Username to use for Nexus upload',
|
||||
required=True)
|
||||
parser.add_argument(
|
||||
'--method',
|
||||
action='store',
|
||||
nargs='?',
|
||||
const='post',
|
||||
choices=['post', 'put'],
|
||||
help=('Method used for uploading files to nexus. '
|
||||
'Apt repositories use post, Helm uses put.'),
|
||||
required=True)
|
||||
parser.add_argument(
|
||||
'--password',
|
||||
action='store',
|
||||
help=("Password to use for Nexus upload. "
|
||||
"If parameter not given, we'll interactively ask"))
|
||||
# Positional arguments
|
||||
parser.add_argument('file', nargs='+', type=str)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
"""Upload debian package to nexus repository"""
|
||||
if options.get('password') is None:
|
||||
options['password'] = getpass()
|
||||
responses = {}
|
||||
url = 'https://%(url)s/repository/%(repo)s//' % options
|
||||
method = options.get('method')
|
||||
exit_code = 0
|
||||
for file in options.get('file'):
|
||||
if method == 'post':
|
||||
responses[file] = requests.post(url, data=open(file, mode='rb'),
|
||||
auth=(options.get('user'), options.get('password')))
|
||||
else:
|
||||
responses[file] = requests.put(url+file, data=open(file, mode='rb'),
|
||||
auth=(options.get('user'), options.get('password')))
|
||||
self.stdout.write('Upload results:\n')
|
||||
sep = '-' * 60
|
||||
self.stdout.write('%s\n' % sep)
|
||||
for path, response in responses.items():
|
||||
self.stdout.write('%-55s: %d\n' % (path, response.status_code))
|
||||
if response.status_code >= 400:
|
||||
exit_code = 1
|
||||
self.stdout.write('%s\n' % sep)
|
||||
exit(exit_code)
|
@ -1,2 +1,2 @@
|
||||
"""Passbook ldap app Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook lib"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -23,7 +23,7 @@ web:
|
||||
listen: 0.0.0.0
|
||||
port: 8000
|
||||
threads: 30
|
||||
debug: true
|
||||
debug: false
|
||||
secure_proxy_header:
|
||||
HTTP_X_FORWARDED_PROTO: https
|
||||
redis: localhost
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook oauth_client Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook oauth_provider Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook saml_idp Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
@ -1,2 +1,2 @@
|
||||
"""passbook totp Header"""
|
||||
__version__ = '0.0.5-alpha'
|
||||
__version__ = '0.0.6-alpha'
|
||||
|
Reference in New Issue
Block a user