This commit is contained in:
cupcakearmy 2019-12-22 19:59:57 +01:00
parent 136ac20101
commit 0a0a38d9db
20 changed files with 169 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import sys
print(f'Hi, I am {sys.version}')

View File

@ -0,0 +1,5 @@
FROM python:{{ version }}-alpine
COPY ./hi.py .
CMD [ "python", "hi.py" ]

10
examples/context/spec.yml Normal file
View File

@ -0,0 +1,10 @@
variables:
version:
- 3.8
- 3.7
recipe: ./simple.j2
context: ./foo/bar
run: yes
parallel: no

View File

@ -0,0 +1,3 @@
FROM alpine:{{ version}}
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]

View 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

View 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" ]

View File

@ -0,0 +1,3 @@
from termcolor import cprint
cprint('Hello 👋', 'blue', attrs=['bold'])

View File

@ -0,0 +1,3 @@
from termcolor import colored
print(colored('Hello 👋', 'blue', attrs=['bold']))

View 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

View File

@ -0,0 +1,2 @@
foo:$2y$05$dxXE5QaBKd5eV0gLBxFJtOJpAHKEusdZfPC2Ucssyg3s/2YjoRIXW

25
examples/full/spec.yml Normal file
View 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

View File

@ -0,0 +1,3 @@
FROM alpine
CMD [ "echo", "Hi {{ name }} from {{ os }}" ]

View File

@ -0,0 +1,3 @@
FROM debian
CMD [ "echo", "Hi {{ name }} from {{ os }}" ]

View File

@ -0,0 +1,13 @@
variables:
os:
- alpine
- debian
name:
- Alice
- Bob
recipe: './recipes/{{ os }}.j2'
tag: 'hello:{{os}}-{{name}}'
run: yes
parallel: no

View 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

View File

@ -0,0 +1,2 @@
foo:$2y$05$dxXE5QaBKd5eV0gLBxFJtOJpAHKEusdZfPC2Ucssyg3s/2YjoRIXW

View File

@ -0,0 +1,3 @@
FROM alpine:{{ version}}
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]

View 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

View File

@ -0,0 +1,3 @@
FROM alpine:{{ version }}
CMD [ "echo", "Hi {{ name }} from {{ version }}" ]

13
examples/simple/spec.yml Normal file
View File

@ -0,0 +1,13 @@
variables:
version:
- 3.11
- 3.10
- 3.9
name:
- Alice
- Bob
recipe: ./simple.j2
run: yes
parallel: no