Skip to content

Commit

Permalink
Mostly a wrapper around docker hub now.
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-b committed Dec 22, 2023
1 parent 31c2777 commit bd8525d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build/
*~
*.bak

publish.sh
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,34 @@ VERSION=1.0.0-alpha

TAG=${ARCH}-${VERSION}

all: dist/pijul-${TAG} dist/pijul-serve-${TAG}.tar.gz
all: dist/pijul-${TAG} dist/pijul-bootstrap-${TAG}.tar.gz

dist/pijul dist/pijul-${TAG} dist/pijul-${TAG}.tar : .image build/pijul-${TAG}
rm -rf dist
mkdir dist
cp build/pijul-${TAG} dist/pijul-${TAG}
rm -rf build
docker save -o dist/pijul-serve-${TAG}.tar pijul-serve:${TAG}
gzip dist/pijul-serve-${TAG}.tar
docker save -o dist/pijul-bootstrap-${TAG}.tar pijul-bootstrap:${TAG}
gzip dist/pijul-bootstrap-${TAG}.tar

build/pijul-${TAG}: .image
rm -rf build && mkdir -p build
docker run -v "$(PWD)/build:/build:rw" --entrypoint /bin/cp pijul-serve:${TAG} /usr/local/bin/pijul /build/pijul-${TAG}
docker run -v "$(PWD)/build:/build:rw" --entrypoint /bin/cp pijul-bootstrap:${TAG} /usr/local/bin/pijul /build/pijul-${TAG}

.image: Dockerfile
docker build -t pijul-serve:${TAG} .
docker tag pijul-serve:${TAG} pijul-serve:latest
docker build -t pijul-bootstrap:${TAG} .
docker tag pijul-bootstrap:${TAG} pijul-bootstrap:latest
touch .image

run: .image
docker run -ti pijul-serve:${TAG} pijul
docker run -ti pijul-bootstrap:${TAG} pijul

clean:
rm -rf dist build .image

# developers only
publish: .image ./publish.sh
./publish.sh "${TAG}"

.PHONY: dist

76 changes: 36 additions & 40 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
= Pijul Bootstrap

This is a quick way to get started with https://pijul.org[Pijul]. Pijul is a **much better** version control system than `git`, but is a bit painful to initially install, because it depends on either itself or rust+cargo+nix.
This is a quick way to get started with https://pijul.org[Pijul].

Instead, this repo provides `pijul`` as:
Pijul is a **much better** version control system than `git`, but is a bit painful to initially install, because it depends on either itself or rust+cargo+nix. I think that Pijul deserves to do better, and making it easier to get started with will probably help, so this is an easier way.

- a pre-compiled as a binary for amd64 linux, which only needs some commonly available distro libraries
- a Docker Linux container image tarball, which you can download, import, and run (or use as a base image to extend) with no further dependencies (except docker/podman)
- A simple `pij` script that runs the docker image provided above (once it has been manually installed - a docker upload will come soon, meaning no manual installation other than the script itself).
This repo provides `pijul` as:

== Binary executable installation
- (primarily) a wrapper script that "just works", if you have docker installed and working.
- (optionally) a pre-compiled as a binary for amd64 linux, which only needs some commonly available distro libraries
1. Download the latest pijul-$VERSION-$ARCH release executable and install it **(as root)** to /usr/local/bin (set VERSION and ARCH to match what you downloaded, of course):
== User-only install (for docker):

1. Download the `bin/pij` script, and install it to `$HOME/.local/bin`:
+
[source,shell]
----
VERSION=1.0.0-alpha
ARCH=x86_64
install pijul-$ARCH-$VERSION /usr/local/bin/pijul
install pij $HOME/.local/bin
----

2. Install the dependencies.
2. Add this directory to your shell path. For bash, for example:
+
For debian-likes (Debian, Ubuntu, Devuan), this command is:
[source,shell]
----
RUN apt-get update && apt-get install -y libsodium23 libssl3
echo >> ~/.bashrc 'export PATH="$HOME/.local/bin:$PATH"'
----

3. Run `pijul` as usual

3. Run `pijul` as normal, per the official documentation.

== Docker image

The docker image can be downloaded from releases, and used as follows (again, set VERSION and ARCH to match what you downloaded, of course):
== System-wide install (for docker):

1. Import the docker save image:
1. Download the `bin/pij` script, and install it **(as root)**, to `/usr/local/bin/pijul`:
+
[source,shell]
----
VERSION=1.0.0-alpha
ARCH=x86_64
gunzp pijul-serve-${ARCH}-${VERSION}.tar.gz
docker import pijul-serve-${ARCH}-${VERSION}.tar
install pij /usr/local/bin/pijul
----

3. Tag the version as the latest one:

== Binary executable installation

1. Download the latest pijul-$VERSION-$ARCH release executable and install it **(as root)** to /usr/local/bin (set VERSION and ARCH to match what you downloaded, of course):
+
[source,shell]
----
docker tag pijul-serve:${ARCH}-${VERSION} pijul-serve:latest
VERSION=1.0.0-alpha
ARCH=x86_64
install pijul-$ARCH-$VERSION /usr/local/bin/pijul
----

4. Run `pijul` using docker
+
You need to map the directory that you want to work in to /workspace, and also be sure to run it as your current user and group id, so that any files are created as you.
2. Install the dependencies.
+
For debian-likes (Debian, Ubuntu, Devuan), this command is:
[source,shell]
----
docker run -u `id -u`:`id -g` -v $(pwd):/workspace -ti pijul-serve
RUN apt-get update && apt-get install -y libsodium23 libssl3
----
+
See below on a script that simplifies this step.

== `pij` wrapper for docker
3. Run `pijul` as usual

1. Download and install the `bin/pij` script **(as root)**:
+
[source,shell]
----
install pij /usr/local/bin
----

2. Run `pij` instead of the more complex `docker run` command given above. They're essentially the same.
== Docker image (from docker hub)

This may be useful if you want to build another container that pijul, such as a container-based pijul repo server. However, you are advised to study the Dockerfile and build your own as needed, rather than relying on this for production updates etc.
+
1. Run `docker pull leebraid/pijul-bootstrap:latest`.
2. Use the `pijul` command within the docker container as usual (consult the docker documentation if unsure at this point).
3. To use this in a Dockerfile, of course just do `FROM docker.io/leebraid/pijul-bootstrap:latest AS base`, or whatever.

3. From now on, you can use `pij` per the documentation for `pijul` on the official website.

== Contributing

- Please fork the code and submit a PR for any improvements. In particular, the following improvements are welcome:

+ Making the rust build fully static
+ Making the rust binary executable build fully static
+ Library installation instructions for distros other than debian-likes.
+ automated CI/CD updates from the pijul repo, so I don't have to maintain this ;)
2 changes: 1 addition & 1 deletion bin/pij
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

docker run -u `id -u`:`id -g` -v $(pwd):/workspace -ti pijul-serve "$@"
docker run -u `id -u`:`id -g` -v $(pwd):/workspace -ti leebraid/pijul-bootstrap:latest "$@"

0 comments on commit bd8525d

Please sign in to comment.