Merge branch 'main' into kotlin-compile
commit
b3a612c938
@ -1,42 +0,0 @@
|
|||||||
name: stable
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: stable build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Use python 3.x
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: build stable release
|
|
||||||
env:
|
|
||||||
TWINE_USERNAME: __token__
|
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_DDA }}
|
|
||||||
run: |
|
|
||||||
pyb -P version=${{ github.ref }} publish upload
|
|
||||||
|
|
||||||
- name: Create GH Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: Release ${{ github.ref }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
name: unstable
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '![0-9]+.[0-9]+.[0-9]+'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: unstable
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Use python 3.x
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: build unstable release
|
|
||||||
env:
|
|
||||||
TWINE_USERNAME: __token__
|
|
||||||
TWINE_PASSWORD: ${{ secrets.PYPI_DDA }}
|
|
||||||
run: |
|
|
||||||
pyb publish upload
|
|
@ -1,6 +1,6 @@
|
|||||||
FROM python:3.10-alpine
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
RUN set -eux;
|
RUN set -eux;
|
||||||
RUN apk add --no-cache python3 py3-pip openssl-dev bash git;
|
RUN apk add --no-cache python3 py3-pip openssl-dev bash git curl;
|
||||||
RUN python3 -m pip install -U pip;
|
RUN python3 -m pip install -U pip;
|
||||||
RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection;
|
RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM python:3.10-alpine
|
FROM python:3.10-alpine
|
||||||
|
|
||||||
RUN set -eux;
|
RUN set -eux;
|
||||||
RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptools py3-wheel libffi-dev openssl-dev cargo bash git;
|
RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptools py3-wheel libffi-dev openssl-dev cargo bash git curl;
|
||||||
RUN python3 -m pip install -U pip;
|
RUN python3 -m pip install -U pip;
|
||||||
RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection;
|
RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection;
|
||||||
RUN pip3 install coverage flake8 flake8-polyfill mypy mypy-extensions pycodestyle pyflakes pylint pytest pytest-cov pytest-datafiles types-setuptools types-PyYAML;
|
RUN pip3 install coverage flake8 flake8-polyfill mypy mypy-extensions pycodestyle pyflakes pylint pytest pytest-cov pytest-datafiles types-setuptools types-PyYAML;
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
from pybuilder.core import Project
|
|
||||||
from .devops_build import DevopsBuild
|
|
||||||
|
|
||||||
# """
|
|
||||||
# Functional Req:
|
|
||||||
|
|
||||||
# General process for deploying prebuilt (meissa) binaries to our own repo server.
|
|
||||||
|
|
||||||
# [-1]
|
|
||||||
# Building is handled by other entities
|
|
||||||
# is another pybuilder task
|
|
||||||
# the binary is reachable with devops.build_path()
|
|
||||||
# we might need to establish a "build" that does lein builds for us
|
|
||||||
# we might need to establish a "build" that does gradlew build for us
|
|
||||||
# same for all other projects that produce binaries
|
|
||||||
# currently the c4k_build.py just creates the auth and config yamls
|
|
||||||
|
|
||||||
# [0]
|
|
||||||
# get artifact deployment url
|
|
||||||
# Base url: https://repo.prod.meissa.de/api/v1/repos/
|
|
||||||
# Changeable: /meissa/provs/
|
|
||||||
# persitent suffix to url: releases
|
|
||||||
# name is accessible from input
|
|
||||||
|
|
||||||
# [1]
|
|
||||||
# get release token
|
|
||||||
# could be an api token for repo.prod.meissa.de
|
|
||||||
# credential mapping as described in the docs
|
|
||||||
|
|
||||||
# [2]
|
|
||||||
# get release tag
|
|
||||||
# is the version of the project
|
|
||||||
# get from gitApi
|
|
||||||
|
|
||||||
# [3]
|
|
||||||
# post a json message containting [2] to [0], watching stdout for answers
|
|
||||||
# authorized by [1]
|
|
||||||
# validate if [3] was successful by reading stdout
|
|
||||||
# or create error message containing ID of release
|
|
||||||
|
|
||||||
# [4]
|
|
||||||
# get release-id from stdout of [3]
|
|
||||||
# print release-id
|
|
||||||
|
|
||||||
# [5]
|
|
||||||
# generate sha256 sums & generate sha512 sums of results of [-1]
|
|
||||||
|
|
||||||
# [6]
|
|
||||||
# push results of [-1] & [5] to [0]/[4]
|
|
||||||
|
|
||||||
# """
|
|
||||||
|
|
||||||
|
|
||||||
class ArtifactDeploymentMixin(DevopsBuild):
|
|
||||||
def __init__(self, project: Project, inp: dict):
|
|
||||||
super().__init__(project, inp)
|
|
@ -0,0 +1,46 @@
|
|||||||
|
from enum import Enum
|
||||||
|
from pathlib import Path
|
||||||
|
from .common import (
|
||||||
|
Validateable,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ArtifactType(Enum):
|
||||||
|
TEXT = 0
|
||||||
|
JAR = 1
|
||||||
|
|
||||||
|
|
||||||
|
class Artifact(Validateable):
|
||||||
|
def __init__(self, path: str):
|
||||||
|
self.path_str = path
|
||||||
|
|
||||||
|
def path(self) -> Path:
|
||||||
|
return Path(self.path_str)
|
||||||
|
|
||||||
|
def type(self) -> str:
|
||||||
|
suffix = self.path().suffix
|
||||||
|
match suffix:
|
||||||
|
case ".jar":
|
||||||
|
return "application/x-java-archive"
|
||||||
|
case ".js":
|
||||||
|
return "application/x-javascript"
|
||||||
|
case _:
|
||||||
|
return "text/plain"
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
result = []
|
||||||
|
result += self.__validate_is_not_empty__("path_str")
|
||||||
|
try:
|
||||||
|
Path(self.path_str)
|
||||||
|
except Exception as e:
|
||||||
|
result += [f"path was not a valid: {e}"]
|
||||||
|
return result
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.path())
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return other and self.__str__() == other.__str__()
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
return self.__str__().__hash__()
|
@ -0,0 +1,32 @@
|
|||||||
|
import pytest
|
||||||
|
from pybuilder.core import Project
|
||||||
|
from pathlib import Path
|
||||||
|
from src.main.python.ddadevops.domain import (
|
||||||
|
Validateable,
|
||||||
|
DnsRecord,
|
||||||
|
Devops,
|
||||||
|
BuildType,
|
||||||
|
MixinType,
|
||||||
|
Artifact,
|
||||||
|
Image,
|
||||||
|
)
|
||||||
|
from .helper import build_devops, devops_config
|
||||||
|
|
||||||
|
|
||||||
|
def test_sould_validate_release():
|
||||||
|
sut = Artifact("x")
|
||||||
|
assert sut.is_valid()
|
||||||
|
|
||||||
|
sut = Artifact(None)
|
||||||
|
assert not sut.is_valid()
|
||||||
|
|
||||||
|
def test_should_calculate_type():
|
||||||
|
sut = Artifact("x.jar")
|
||||||
|
assert "application/x-java-archive" == sut.type()
|
||||||
|
|
||||||
|
sut = Artifact("x.js")
|
||||||
|
assert "application/x-javascript" == sut.type()
|
||||||
|
|
||||||
|
sut = Artifact("x.jar.sha256")
|
||||||
|
assert "text/plain" == sut.type()
|
||||||
|
|
Loading…
Reference in New Issue