mirror of
https://github.com/cupcakearmy/tumbo.git
synced 2024-12-21 07:46:25 +00:00
examples
This commit is contained in:
parent
136ac20101
commit
0a0a38d9db
3
examples/context/foo/bar/hi.py
Normal file
3
examples/context/foo/bar/hi.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
print(f'Hi, I am {sys.version}')
|
5
examples/context/foo/bar/simple.j2
Normal file
5
examples/context/foo/bar/simple.j2
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM python:{{ version }}-alpine
|
||||||
|
|
||||||
|
COPY ./hi.py .
|
||||||
|
|
||||||
|
CMD [ "python", "hi.py" ]
|
10
examples/context/spec.yml
Normal file
10
examples/context/spec.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
variables:
|
||||||
|
version:
|
||||||
|
- 3.8
|
||||||
|
- 3.7
|
||||||
|
|
||||||
|
recipe: ./simple.j2
|
||||||
|
context: ./foo/bar
|
||||||
|
|
||||||
|
run: yes
|
||||||
|
parallel: no
|
3
examples/custom_tag/simple.j2
Normal file
3
examples/custom_tag/simple.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM alpine:{{ version}}
|
||||||
|
|
||||||
|
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]
|
14
examples/custom_tag/spec.yml
Normal file
14
examples/custom_tag/spec.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
variables:
|
||||||
|
version:
|
||||||
|
- 3.11
|
||||||
|
- 3.10
|
||||||
|
- 3.9
|
||||||
|
name:
|
||||||
|
- Alice
|
||||||
|
- Bob
|
||||||
|
|
||||||
|
recipe: ./simple.j2
|
||||||
|
tag: 'my_image:{{version}}-{{name}}'
|
||||||
|
|
||||||
|
run: yes
|
||||||
|
parallel: no
|
13
examples/full/build/Dockerfile.j2
Normal file
13
examples/full/build/Dockerfile.j2
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM python:{{ python_version }}-{{base_image}}
|
||||||
|
|
||||||
|
RUN pip install termcolor=={{ package_version }}
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
{% if package_version == '1.1.0' %}
|
||||||
|
COPY ./new.py main.py
|
||||||
|
{% else %}
|
||||||
|
COPY ./old.py main.py
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
CMD [ "python", "main.py" ]
|
3
examples/full/build/new.py
Normal file
3
examples/full/build/new.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from termcolor import cprint
|
||||||
|
|
||||||
|
cprint('Hello 👋', 'blue', attrs=['bold'])
|
3
examples/full/build/old.py
Normal file
3
examples/full/build/old.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from termcolor import colored
|
||||||
|
|
||||||
|
print(colored('Hello 👋', 'blue', attrs=['bold']))
|
14
examples/full/registry/docker-compose.yml
Normal file
14
examples/full/registry/docker-compose.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
registry:
|
||||||
|
image: registry
|
||||||
|
container_name: registry
|
||||||
|
ports:
|
||||||
|
- 5000:5000
|
||||||
|
volumes:
|
||||||
|
- ./htpasswd:/auth/htpasswd
|
||||||
|
environment:
|
||||||
|
- REGISTRY_AUTH=htpasswd
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
|
2
examples/full/registry/htpasswd
Normal file
2
examples/full/registry/htpasswd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
foo:$2y$05$dxXE5QaBKd5eV0gLBxFJtOJpAHKEusdZfPC2Ucssyg3s/2YjoRIXW
|
||||||
|
|
25
examples/full/spec.yml
Normal file
25
examples/full/spec.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
variables:
|
||||||
|
python_version:
|
||||||
|
- 3.8
|
||||||
|
- 3.7
|
||||||
|
- 3.6
|
||||||
|
- 3.5
|
||||||
|
base_image:
|
||||||
|
- alpine
|
||||||
|
- slim
|
||||||
|
package_version:
|
||||||
|
- 1.1.0
|
||||||
|
- 1.0.1
|
||||||
|
- 1.0.0
|
||||||
|
|
||||||
|
context: ./build
|
||||||
|
recipe: './Dockerfile.j2'
|
||||||
|
tag: "{{package_version}}:{{base_image}}-{{python_version}}"
|
||||||
|
|
||||||
|
parallel: no
|
||||||
|
push: yes
|
||||||
|
run: yes
|
||||||
|
registry:
|
||||||
|
username: foo
|
||||||
|
password: bar
|
||||||
|
host: localhost:5000
|
3
examples/multiple_templates/recipes/alpine.j2
Normal file
3
examples/multiple_templates/recipes/alpine.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM alpine
|
||||||
|
|
||||||
|
CMD [ "echo", "Hi {{ name }} from {{ os }}" ]
|
3
examples/multiple_templates/recipes/debian.j2
Normal file
3
examples/multiple_templates/recipes/debian.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM debian
|
||||||
|
|
||||||
|
CMD [ "echo", "Hi {{ name }} from {{ os }}" ]
|
13
examples/multiple_templates/spec.yml
Normal file
13
examples/multiple_templates/spec.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
variables:
|
||||||
|
os:
|
||||||
|
- alpine
|
||||||
|
- debian
|
||||||
|
name:
|
||||||
|
- Alice
|
||||||
|
- Bob
|
||||||
|
|
||||||
|
recipe: './recipes/{{ os }}.j2'
|
||||||
|
tag: 'hello:{{os}}-{{name}}'
|
||||||
|
|
||||||
|
run: yes
|
||||||
|
parallel: no
|
14
examples/push_to_registry/registry/docker-compose.yml
Normal file
14
examples/push_to_registry/registry/docker-compose.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
version: '3.7'
|
||||||
|
|
||||||
|
services:
|
||||||
|
registry:
|
||||||
|
image: registry
|
||||||
|
container_name: registry
|
||||||
|
ports:
|
||||||
|
- 5000:5000
|
||||||
|
volumes:
|
||||||
|
- ./htpasswd:/auth/htpasswd
|
||||||
|
environment:
|
||||||
|
- REGISTRY_AUTH=htpasswd
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
|
||||||
|
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
|
2
examples/push_to_registry/registry/htpasswd
Normal file
2
examples/push_to_registry/registry/htpasswd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
foo:$2y$05$dxXE5QaBKd5eV0gLBxFJtOJpAHKEusdZfPC2Ucssyg3s/2YjoRIXW
|
||||||
|
|
3
examples/push_to_registry/simple.j2
Normal file
3
examples/push_to_registry/simple.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM alpine:{{ version}}
|
||||||
|
|
||||||
|
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]
|
20
examples/push_to_registry/spec.yml
Normal file
20
examples/push_to_registry/spec.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Run docker-compose up before starting tumbo
|
||||||
|
|
||||||
|
variables:
|
||||||
|
version:
|
||||||
|
- 3.11
|
||||||
|
- 3.10
|
||||||
|
- 3.9
|
||||||
|
name:
|
||||||
|
- Alice
|
||||||
|
- Bob
|
||||||
|
|
||||||
|
recipe: ./simple.j2
|
||||||
|
|
||||||
|
push: yes
|
||||||
|
run: yes
|
||||||
|
parallel: no
|
||||||
|
registry:
|
||||||
|
username: foo
|
||||||
|
password: bar
|
||||||
|
host: localhost:5000
|
3
examples/simple/simple.j2
Normal file
3
examples/simple/simple.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM alpine:{{ version }}
|
||||||
|
|
||||||
|
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]
|
13
examples/simple/spec.yml
Normal file
13
examples/simple/spec.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
variables:
|
||||||
|
version:
|
||||||
|
- 3.11
|
||||||
|
- 3.10
|
||||||
|
- 3.9
|
||||||
|
name:
|
||||||
|
- Alice
|
||||||
|
- Bob
|
||||||
|
|
||||||
|
recipe: ./simple.j2
|
||||||
|
|
||||||
|
run: yes
|
||||||
|
parallel: no
|
Loading…
Reference in New Issue
Block a user