wip deploy
This commit is contained in:
parent
50d27b7cd9
commit
7d8669867c
|
@ -1,3 +1,4 @@
|
|||
_build/
|
||||
_opam/
|
||||
_dist/
|
||||
*.install
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
export OPAMROOTISOK=1
|
||||
|
||||
opam init --disable-sandboxing --no-setup
|
||||
|
||||
eval $(opam env)
|
||||
|
||||
opam pin add ./talircd --kind=path --no-action --yes
|
||||
opam install talircd --destdir=dist
|
||||
|
||||
|
||||
#opam install talircd --destdir=dist --yes
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MACHINE=${MACHINE:-talircd-build}
|
||||
PROJECT_ROOT=${PROJECT_ROOT:-$(git rev-parse --show-toplevel)}
|
||||
DIST_DIR=${DIST_DIR:-${PROJECT_ROOT}/_dist}
|
||||
|
||||
set -x
|
||||
|
||||
mkdir -p "${DIST_DIR}"
|
||||
|
||||
sudo systemd-nspawn -q \
|
||||
--machine ${MACHINE} \
|
||||
--bind-ro ${PROJECT_ROOT}:/root/talircd \
|
||||
--bind ${DIST_DIR}:/root/dist \
|
||||
--chdir /root \
|
||||
/root/talircd/deploy/_run.sh
|
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MACHINE=${MACHINE:-talircd-build}
|
||||
MACHINE_PATH=/var/lib/machines/${MACHINE}
|
||||
PROJECT_ROOT=${PROJECT_ROOT:-$(git rev-parse --show-toplevel)}
|
||||
DIST_DIR=${DIST_DIR:-${PROJECT_ROOT}/_dist}
|
||||
|
||||
CODENAME=bullseye
|
||||
MIRROR=${MIRROR:-http://debian.csail.mit.edu/debian/}
|
||||
|
||||
COMMAND=${1:-build}
|
||||
|
||||
set -x
|
||||
|
||||
function init() {
|
||||
# TODO: fakeroot ?
|
||||
|
||||
sudo debootstrap \
|
||||
--include=ocaml-base,ocaml,opam,ca-certificates,git,rsync \
|
||||
--components=main,contrib \
|
||||
${CODENAME} ${MACHINE_PATH} ${MIRROR}
|
||||
}
|
||||
|
||||
function cleanall() {
|
||||
sudo rm -rf ${MACHINE_PATH}
|
||||
}
|
||||
|
||||
function clean() {
|
||||
sudo systemd-nspawn -q \
|
||||
--machine ${MACHINE} \
|
||||
rm -rf /root/.opam
|
||||
}
|
||||
|
||||
function build() {
|
||||
sudo systemd-nspawn -q \
|
||||
--machine ${MACHINE} \
|
||||
--bind-ro ${PROJECT_ROOT}:/root/talircd \
|
||||
--bind ${DIST_DIR}:/root/dist \
|
||||
--chdir /root \
|
||||
/root/talircd/deploy/_build.sh
|
||||
}
|
||||
|
||||
case $1 in
|
||||
init) init ;;
|
||||
build) build ;;
|
||||
clean) clean ;;
|
||||
cleanall) cleanall ;;
|
||||
*)
|
||||
echo "$1"
|
||||
esac
|
||||
|
||||
# mkdir -p "${DIST_DIR}"
|
Loading…
Reference in New Issue