base.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. ctr=$(buildah from alpine:latest)
  3. mnt=$(buildah mount "$ctr")
  4. mkdir -p "$mnt/srv/tcms" "$mnt/tmp/tcms"
  5. cp -R bin/ config/ data/ www/ lib "$mnt/srv/tcms";
  6. cp Makefile.PL "$mnt/tmp/tcms/"
  7. make -C "$mnt/srv/tcms" --makefile "$PWD/Makefile" prereq-frontend reset-dummy-data
  8. buildah run -- $ctr sh <<EOF
  9. apk update
  10. apk add perl perl-xml-libxml perl-moose perl-datetime perl-dbi perl-dbd-sqlite perl-capture-tiny perl-date-format
  11. # needed for install
  12. apk add curl make musl-dev perl-dev gcc mlocate perl-app-cpanminus
  13. cpanm -n --no-wget --curl --installdeps /tmp/tcms/
  14. apk del curl make musl-dev perl-dev gcc mlocate perl-app-cpanminus
  15. EOF
  16. rm -rf \
  17. "$mnt/tmp/tcms" \
  18. "$mnt/var/cache/*" \
  19. "$mnt/root/.cpanm" \
  20. "$mnt/usr/share/man/" \
  21. "$mnt/usr/local/share/man"
  22. find "$mnt/usr/lib/perl5" -name '*.pod' -delete
  23. buildah config \
  24. --workingdir "/srv/tcms/" \
  25. --entrypoint '["/usr/local/bin/starman"]' \
  26. --cmd "/srv/tcms/www/server.psgi" \
  27. --port 5000 \
  28. --label "Name=tCMS" \
  29. --author "George Baugh" \
  30. "$ctr"
  31. buildah commit --rm "$ctr" tcms