[skip-ci] update doc

This commit is contained in:
Michael Jerger 2023-06-02 17:21:37 +02:00
parent 90a1b342b7
commit 33d05cfb94
11 changed files with 8 additions and 132 deletions

View file

@ -26,7 +26,7 @@ classDiagram
## Example Usage ## Example Usage
### build.py
```python ```python
from subprocess import run from subprocess import run
@ -59,3 +59,9 @@ def list_build_dir(project):
build = get_devops_build(project) build = get_devops_build(project)
run(f"ls -la {build.build_path()}") run(f"ls -la {build.build_path()}")
``` ```
### call the build
```bash
pyb list_build_dir
```

View file

@ -1,4 +0,0 @@
bucket = "my-configuration"
key = "my-module"
kms_key_id = "arn:aws:kms:my-kms-alias"
region = "my-region"

View file

@ -1,55 +0,0 @@
from os import environ
from pybuilder.core import task, init
from ddadevops import *
name = 'my-project'
MODULE = 'my-module'
PROJECT_ROOT_PATH = '../../..'
class MyBuild(AwsBackendPropertiesMixin, DevopsTerraformBuild):
pass
@init
def initialize(project):
project.build_depends_on('ddadevops>=1.0')
stage = environ['STAGE']
print('Doing stage: ', stage)
config = create_devops_terraform_build_config(stage,
PROJECT_ROOT_PATH,
MODULE,
{},
use_workspace=False,
terraform_semantic_version="1.0.8")
config = add_aws_backend_properties_mixin_config(config, 'prod')
build = MyBuild(project, config)
build.initialize_build_dir()
@task
def plan(project):
build = get_devops_build(project)
build.plan()
@task
def tf_apply(project):
build = get_devops_build(project)
build.apply(True)
@task
def apply(project):
build = get_devops_build(project)
build.apply(True)
@task
def destroy(project):
build = get_devops_build(project)
build.destroy(True)
@task
def tf_import(project):
build = get_devops_build(project)
build.tf_import('aws_route53_record.v4', 'my-resource-id')

View file

@ -1,7 +0,0 @@
resource "aws_route53_record" "v4" {
zone_id = "my-zone-id-${var.stage}"
name = "test"
type = "A"
ttl = "300"
records = ["8.8.8.8"]
}

View file

@ -1,42 +0,0 @@
from pybuilder.core import task, init
from ddadevops import *
name = 'example-project'
MODULE = 'docker-module'
PROJECT_ROOT_PATH = '../../..'
class MyBuild(DevopsImageBuild):
pass
@init
def initialize(project):
project.build_depends_on('ddadevops>=0.6.0')
stage = 'prod'
dockerhub_user = gopass_field_from_path('your-credential-path', 'login')
dockerhub_password = gopass_password_from_path('your-credential-path')
config = create_devops_docker_build_config(
stage, PROJECT_ROOT_PATH, MODULE, dockerhub_user, dockerhub_password)
build = MyBuild(project, config)
build.initialize_build_dir()
@task
def image(project):
build = get_devops_build(project)
build.image()
@task
def drun(project):
build = get_devops_build(project)
build.drun()
@task
def publish(project):
build = get_devops_build(project)
build.dockerhub_login()
build.dockerhub_publish()
@task
def test(project):
build = get_devops_build(project)
build.test()

View file

@ -1 +0,0 @@
FROM ubuntu:18.04

View file

@ -1,13 +0,0 @@
#!/bin/bash
function main() {
upgradeSystem
# do some stuff
cleanupDocker
}
source /tmp/resources/install_functions.sh
main

View file

@ -1,7 +0,0 @@
FROM docker-module
RUN curl -L -o /tmp/serverspec.jar \
https://github.com/DomainDrivenArchitecture/dda-serverspec-crate/releases/download/1.3.4/dda-serverspec-standalone.jar
COPY serverspec.edn /tmp/serverspec.edn
RUN java -jar /tmp/serverspec.jar /tmp/serverspec.edn -v

View file

@ -1 +0,0 @@
{:file [{:path "/tmp/resources" :exits false}]}