diff options
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"] |