diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-02-10 19:14:55 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-02-11 18:22:38 +0100 |
commit | c2fb88e4ea953d4dbc01ffc6341ccb4e9e59290c (patch) | |
tree | 8b6d21dd6a91a6e014beecb58bff32cd08542d06 /examples | |
parent | f1eca4972dafc3e5eeb63a1efd65f76d2d7c6ed4 (diff) |
Remove simple examples, add complex one
This patch removes the many simple examples and replaces them with one
big example repository with 26 packages that have a complex dependency
setup.
This is nice for testing.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'examples')
96 files changed, 306 insertions, 738 deletions
diff --git a/examples/packages/1/Makefile b/examples/packages/1/Makefile deleted file mode 100644 index 9de0fb9..0000000 --- a/examples/packages/1/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -.PHONY: all -all: directories copyrepo - -directories: ${BUTIDO_RELEASES} ${BUTIDO_STAGING} ${BUTIDO_SOURCE_CACHE} ${BUTIDO_LOG_DIR} ${BUTIDO_REPO} - - -# to start a webserver for serving the source files. -webserver: ./sources ${BUTIDO_SOURCE_CACHE} - devd -A 127.0.0.1 -p 8180 -T ./sources - - -copyrepo: ${BUTIDO_REPO} check-env - cp -rv ./repo/* ${BUTIDO_REPO}/ - cd ${BUTIDO_REPO}/ && git init && git add . && git commit -m init - -${BUTIDO_RELEASES}: check-env - mkdir -p "${BUTIDO_RELEASES}" - -${BUTIDO_STAGING}: check-env - mkdir -p "${BUTIDO_STAGING}" - -${BUTIDO_SOURCE_CACHE}: check-env - mkdir -p "${BUTIDO_SOURCE_CACHE}" - -${BUTIDO_LOG_DIR}: check-env - mkdir -p "${BUTIDO_LOG_DIR}" - -${BUTIDO_REPO}: check-env - mkdir -p "${BUTIDO_REPO}" - - -check-env: -ifndef BUTIDO_RELEASES - $(error BUTIDO_RELEASES is undefined) -endif -ifndef BUTIDO_STAGING - $(error BUTIDO_STAGING is undefined) -endif -ifndef BUTIDO_SOURCE_CACHE - $(error BUTIDO_SOURCE_CACHE is undefined) -endif -ifndef BUTIDO_LOG_DIR - $(error BUTIDO_LOG_DIR is undefined) -endif -ifndef BUTIDO_REPO - $(error BUTIDO_REPO is undefined) -endif -ifndef BUTIDO_DATABASE_HOST - $(error BUTIDO_DATABASE_HOST is undefined) -endif -ifndef BUTIDO_DATABASE_PORT - $(error BUTIDO_DATABASE_PORT is undefined) -endif -ifndef BUTIDO_DATABASE_USER - $(error BUTIDO_DATABASE_USER is undefined) -endif -ifndef BUTIDO_DATABASE_PASSWORD - $(error BUTIDO_DATABASE_PASSWORD is undefined) -endif -ifndef BUTIDO_DATABASE_NAME - $(error BUTIDO_DATABASE_NAME is undefined) -endif diff --git a/examples/packages/1/README.md b/examples/packages/1/README.md deleted file mode 100644 index 4c680d2..0000000 --- a/examples/packages/1/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Example 1 - -This is an example of packages. - -It contains only scripts that are packaged and not real packages, but it tries -to resemble a real packaging process cleanly, including downloads and even -failing builds (configurable via ENV variables). - - -## Setup - -The top-level `shell.nix` file contains a list of environment variables that are -required for butido and the Makefile to automagically find the right locations. - -The `shell.nix` file can be called with -`nix-shell ./shell.nix --argstr example 1` to explicitely select the environment -for example 1. - - -## Downloads - -The downloads are done from localhost, where a (python) web server has to serve -the files. -Butido can download from there. - - -## Packages - -The packages are dependend on eachother like this: - -``` -a - `- b - | `- d - | | `- i - | `- e - | `- f - `- c - `- g - `- h - `- j -``` - -## Database - -The database host is to be expected to run with the settings specified in the -`shell.nix` file (see `example_1_env`). - -See `/scripts/dev-pg-container.sh` for how to start the container. -Use `diesel db reset` to setup the database. - - -## Build - -The actual build is done in /tmp, where directories are created for the sources, -staging packages, released packages, the repository of package definitions and -the logs. - -The `Makefile` can be used to do this. - diff --git a/examples/packages/1/repo/a/pkg.toml b/examples/packages/1/repo/a/pkg.toml deleted file mode 100644 index 6261999..0000000 --- a/examples/packages/1/repo/a/pkg.toml +++ /dev/null @@ -1,14 +0,0 @@ -name = "a" -version = "1" - -[sources.src] -url = "http://localhost:8180/a-1.source" -hash.hash = "eb68d0823f7047958133e66ebedc923825e8a8fe" - -[dependencies] -runtime = ["b =2", "c =3"] - -[phases] -build.script = ''' - echo "Building {{name}} in version {{version}}" -''' diff --git a/examples/packages/1/repo/b/pkg.toml b/examples/packages/1/repo/b/pkg.toml deleted file mode 100644 index df8cd3f..0000000 --- a/examples/packages/1/repo/b/pkg.toml +++ /dev/null @@ -1,41 +0,0 @@ -name = "b" -version = "2" - -[sources.src] -url = "http://localhost:8180/b-2.source" -hash.hash = "89cad6f574693c02c8ecf94983ec20ffad43af0b" - -[dependencies] -build = ["f =6"] -runtime = ["d =4", "e =5"] - -[environment] -FOO = "123" -BAR = "bla" - -[phases] -build.script = ''' - echo "Look my pretty variables: $FOO" - if [[ -z "$FOO" ]]; then - {{state "ERR" "Failed to find variable FOO"}} - exit 1 - fi - - if [[ "$FOO" != "123" ]]; then - {{state "ERR" "FOO is not equal to '123'"}} - exit 1 - fi - - echo "Look my pretty variables: $BAR" - if [[ -z "$BAR" ]]; then - {{state "ERR" "Failed to find variable BAR"}} - exit 1 - fi - - if [[ "$BAR" != "bla" ]]; then - {{state "ERR" "BAR is not equal to 'bla'"}} - exit 1 - fi - - echo "Building {{name}} in version {{version}}" -''' diff --git a/examples/packages/1/repo/c/pkg.toml b/examples/packages/1/repo/c/pkg.toml deleted file mode 100644 index 67533fb..0000000 --- a/examples/packages/1/repo/c/pkg.toml +++ /dev/null @@ -1,15 +0,0 @@ -name = "c" -version = "3" - -[sources.src] -url = "http://localhost:8180/c-3.source" -hash.hash = "ee4110c6e42791861e5720646c965580a0ddae8d" - -[dependencies] -runtime = ["g =7", "h =8"] - - -[phases] -build.script = ''' - echo "Building {{name}} in version {{version}}" -''' diff --git a/examples/packages/1/repo/config.toml b/examples/packages/1/repo/config.toml deleted file mode 100644 index 79f9fc8..0000000 --- a/examples/packages/1/repo/config.toml +++ /dev/null @@ -1,41 +0,0 @@ -# Configuration file for BUTIDO for this repository - -# In the example, these are configured via the environment. -# See README.md -#releases = "/tmp/example-1-releases" -#staging = "/tmp/example-1-staging" -#source_cache = "/tmp/example-1-sources" -#log_dir = "/tmp/example-1-logs" -#database_host = "localhost" -#database_port = 5432 -#database_user = "pgdev" -#database_password = "password" -#database_name = "butido" - -script_highlight_theme = "Solarized (dark)" - -script_linter = "linterscript" - -# Phases which can be configured in the packages -available_phases = [ "checksource", "unpack", "build", "package" ] - -[docker] -# Images which can be used to build -# images not listed here are automatically rejected -images = [ "debian:bullseye" ] -verify_images_present = true - -# List of docker endpoints -[[docker.endpoints]] -name = "localhost" -uri = "http://0.0.0.0:8095" -endpoint_type = "http" -speed = 1 -maxjobs = 10 - -[containers] -# environment variables which are allowed during container start -# This way, errors (typos) when passing environment to a build can be prevented -check_env_names = true -allowed_env = [ "FOO", "BAR" ] - diff --git a/examples/packages/1/repo/d/pkg.toml b/examples/packages/1/repo/d/pkg.toml deleted file mode 100644 index ff4430d..0000000 --- a/examples/packages/1/repo/d/pkg.toml +++ /dev/null @@ -1,14 +0,0 @@ -name = "d" -version = "4" - -[sources.src] -url = "http://localhost:8180/d-4.source" -hash.hash = "e8332116d7a7104f4affc10b6c65a93027441437" - -[dependencies] -build = ["i =9"] - -[phases] -build.script = ''' - echo "Building {{name}} in version {{version}}" |