IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Started implementing volume commands.

tags/0.92
parent
commit
13591cab3f
3 changed files with 53 additions and 6 deletions
  1. +8
    -6
      Fockerfile
  2. +27
    -0
      focker.py
  3. +18
    -0
      volume.py

+ 8
- 6
Fockerfile View File

@@ -1,13 +1,15 @@
base: freebsd-latest
steps:
- run: |
pkg -y install -y python3 && \
pkg -y install -y py37-pip
- run: |
pkg install -y py37-yaml
- copy:
- [ '/tmp/x', '/etc/x' ]
- [ 'focker-compose.yml', '/etc/focker-compose.yml' ]
- run: |
pkg install py37-certbot
pkg install -y python3 && \
pkg install -y py37-pip && \
pkg install -y py37-yaml && \
pkg install -y py37-certbot && \
mkdir -p /persist/etc/ssh && \
sed -i '' -e 's/\/etc\/ssh\/ssh_host_/\/persist\/etc\/ssh\/ssh_host_/g' /etc/rc.d/sshd && \
sed -i '' -e 's/\/etc\/ssh\/ssh_host_/\/persist\/etc\/ssh\/ssh_host_/g' /etc/ssh/sshd_config && \
sed -i '' -e 's/#HostKey/HostKey/g' /etc/ssh/sshd_config

+ 27
- 0
focker.py View File

@@ -8,6 +8,11 @@ from .image import command_image_build, \
command_image_list, \
command_image_prune, \
command_image_remove
from .volume import command_volume_create, \
command_volume_prune, \
command_volume_list, \
command_volume_tag, \
command_volume_untag
import sys
from .zfs import zfs_init
from .jail import command_jail_run
@@ -17,6 +22,7 @@ def create_parser():
parser_top = ArgumentParser()
subparsers_top = parser_top.add_subparsers()
# image
subparsers = subparsers_top.add_parser('image').add_subparsers()
parser = subparsers.add_parser('build')
parser.set_defaults(func=command_image_build)
@@ -45,12 +51,33 @@ def create_parser():
# parser.add_argument('--remove-children', '-r', action='store_true')
parser.add_argument('--remove-dependents', '-R', action='store_true')
# jail
subparsers = subparsers_top.add_parser('jail').add_subparsers()
parser = subparsers.add_parser('run')
parser.set_defaults(func=command_jail_run)
parser.add_argument('image', type=str)
parser.add_argument('--command', '-c', type=str, default='/bin/sh')
# volume
subparsers = subparsers_top.add_parser('volume').add_subparsers()
parser = subparsers.add_parser('create')
parser.set_defaults(func=command_volume_create)
parser.add_argument('--tag', '-t', type=str, nargs='+', default=[])
parser = subparsers.add_parser('prune')
parser.set_defaults(func=command_volume_prune)
parser = subparsers.add_parser('list')
parser.set_defaults(func=command_volume_list)
parser = subparsers.add_parser('tag')
parser.set_defaults(func=command_volume_tag)
parser.add_argument('tags', type=str, nargs='+')
parser = subparsers.add_parser('untag')
parser.set_defaults(func=command_volume_untag)
parser.add_argument('tags', type=str, nargs='+')
return parser_top


+ 18
- 0
volume.py View File

@@ -0,0 +1,18 @@
def command_volume_create(args):
raise NotImplementedError
def command_volume_prune(args):
raise NotImplementedError
def command_volume_list(args):
raise NotImplementedError
def command_volume_tag(args):
raise NotImplementedError
def command_volume_untag(args):
raise NotImplementedError

Loading…
Cancel
Save