summaryrefslogtreecommitdiffstats
path: root/examples/packages/1
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-09 09:32:15 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-09 17:24:50 +0100
commitf53375ec115cdff6c53dbcef1a8ad36d8c23040f (patch)
treead7c9f74fa04261ff0795589c6d6b4746d0f615f /examples/packages/1
parentec54e096a857fec587b88a6a55ffd1d6cd82d82f (diff)
Remove old examples, rename example 3 to scripts
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'examples/packages/1')
-rw-r--r--examples/packages/1/a/pkg.toml17
-rw-r--r--examples/packages/1/b/pkg.toml18
-rw-r--r--examples/packages/1/c/pkg.toml14
-rw-r--r--examples/packages/1/config.toml49
-rw-r--r--examples/packages/1/pkg.toml65
5 files changed, 163 insertions, 0 deletions
diff --git a/examples/packages/1/a/pkg.toml b/examples/packages/1/a/pkg.toml
new file mode 100644
index 0000000..64364a2
--- /dev/null
+++ b/examples/packages/1/a/pkg.toml
@@ -0,0 +1,17 @@
+name = "a"
+version = "1"
+
+[dependencies]
+runtime = ["b =2", "c =3"]
+
+[phases]
+package.script = '''
+ mkdir /outputs
+ echo "#BUTIDO:PHASE:package"
+ echo "#BUTIDO:PROGRESS:90"
+
+ touch /outputs/a-1.pkg
+
+ echo "#BUTIDO:PROGRESS:100"
+ echo "#BUTIDO:STATE:OK:finished"
+'''
diff --git a/examples/packages/1/b/pkg.toml b/examples/packages/1/b/pkg.toml
new file mode 100644
index 0000000..2ca66e2
--- /dev/null
+++ b/examples/packages/1/b/pkg.toml
@@ -0,0 +1,18 @@
+name = "b"
+version = "2"
+
+[environment]
+FOO = "bar"
+BAZ = "bla"
+
+[phases]
+package.script = '''
+ mkdir /outputs
+ echo "#BUTIDO:PHASE:package"
+ echo "#BUTIDO:PROGRESS:90"
+
+ touch /outputs/b-2.pkg
+
+ echo "#BUTIDO:PROGRESS:100"
+ echo "#BUTIDO:STATE:OK:finished"
+'''
diff --git a/examples/packages/1/c/pkg.toml b/examples/packages/1/c/pkg.toml
new file mode 100644
index 0000000..538c576
--- /dev/null
+++ b/examples/packages/1/c/pkg.toml
@@ -0,0 +1,14 @@
+name = "c"
+version = "3"
+
+[phases]
+package.script = '''
+ mkdir /outputs
+ echo "#BUTIDO:PHASE:package"
+ echo "#BUTIDO:PROGRESS:90"
+
+ touch /outputs/c-3.pkg
+
+ echo "#BUTIDO:PROGRESS:100"
+ echo "#BUTIDO:STATE:OK:finished"
+'''
diff --git a/examples/packages/1/config.toml b/examples/packages/1/config.toml
new file mode 100644
index 0000000..fc0244b
--- /dev/null
+++ b/examples/packages/1/config.toml
@@ -0,0 +1,49 @@
+# Configuration file for BUTIDO for this repository
+
+# repository of package definitions
+releases = "/tmp/example-3-releases"
+staging = "/tmp/example-3-staging"
+source_cache = "/tmp/example-3-sources"
+log_dir = "/tmp/example-3-logs"
+
+script_highlight_theme = "Solarized (dark)"
+
+# ####
+#
+# Log database configuration
+#
+# ####
+
+# The database to use
+#
+# Can be overridden via environment vairbale BUTIDO_DATABASE_URI or set via CLI.
+database_host = "localhost"
+database_port = 5432
+database_user = "pgdev"
+database_password = "password"
+database_name = "butido"
+
+
+# Phases which can be configured in the packages
+available_phases = [ "unpack", "depinst", "configure", "build", "install", "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 = "example host name"
+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
+allowed_env = [ "PATH" ]
+
diff --git a/examples/packages/1/pkg.toml b/examples/packages/1/pkg.toml
new file mode 100644
index 0000000..f908065
--- /dev/null
+++ b/examples/packages/1/pkg.toml
@@ -0,0 +1,65 @@
+version = "1"
+version_is_semver = false
+
+# no patches by default
+patches = []
+
+[sources.src]
+url = "https://github.com/user/repo/archive/sources.tar.gz"
+hash.type = "sha1"
+hash.hash = "5e8bcaa3c758f84f01935a914e2bbf01309462ae"
+
+[dependencies]
+build = []
+runtime = []
+
+# Root description of phases
+# can be overridden as well
+[phases]
+
+unpack.script = '''
+ {{#each sources}}
+ echo "{{@key}} {{this.url}}"
+ echo " {{this.hash.hash}}"
+ ls /inputs/{{@key}}-{{this.hash.hash}}.source
+ {{/each}}
+
+ mkdir /build
+ echo "#BUTIDO:PHASE:unpack"
+'''
+
+# We use a depinst phase here because we don't want to add a Dockerfile to the
+# repo where we prepare a build container.
+# This is, of course, not be the way it would be done in a real-world scenario!
+depinst.script = '''
+ {{phase "depinst"}}
+ {{progress 0}}
+ for n in {1..10}; do sleep 0.1; done
+ {{progress 10}}
+'''
+
+configure.script = '''
+ {{phase "configure-preparing"}}
+ for n in {1..10}; do sleep 0.1; done
+
+ {{progress 20}}
+ for n in {1..10}; do sleep 0.1; done
+'''
+
+build.script = '''
+ {{phase "build"}}
+
+ for n in {1..10}; do sleep 0.1; done
+
+ echo "#BUTIDO:PROGRESS:60"
+ {{progress 60}}
+'''
+
+install.script = '''
+ {{phase "install"}}
+ for n in {1..10}; do sleep 0.1; done
+
+ {{progress 80}}
+'''
+
+