summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-06-13 18:55:14 +0300
committerLars Wirzenius <liw@liw.fi>2015-06-13 18:55:14 +0300
commitc60eb397380ae881e6a7b3815e5a493b64268dc1 (patch)
treecad21f392eb93d90c3d2da4b723b67a13088bbda /doc
parente353685fd35333cdd02abbb8d45cefe68f629028 (diff)
downloadick-c60eb397380ae881e6a7b3815e5a493b64268dc1.tar.gz
Add scenario for really building a Debian package
Diffstat (limited to 'doc')
-rw-r--r--doc/070-pipeline.yarn25
-rw-r--r--doc/900-implements.yarn37
2 files changed, 57 insertions, 5 deletions
diff --git a/doc/070-pipeline.yarn b/doc/070-pipeline.yarn
new file mode 100644
index 0000000..d7262a9
--- /dev/null
+++ b/doc/070-pipeline.yarn
@@ -0,0 +1,25 @@
+# Building Debian packages with Ick
+
+This chapter describes how to actually use Ick to build Debian
+packages. We'll use Ick to actually build a toy package. This assumes
+we have the necessary access to localhost.
+
+ SCENARIO build Debian packages
+
+First of all, we need a git repository with some source code.
+
+ GIVEN a source code repository for project foo version 1.2-1
+
+Then we need an Ick file.
+
+ AND an ick file foo.ick
+ AND foo.ick uses localhost as a target
+ AND foo.ick builds foo using project type debian
+ AND foo.ick builds foo from repository foo
+ AND foo.ick builds foo from branch master
+
+Then we do the build.
+
+ WHEN user runs ick foo.ick
+ THEN the APT repository for foo.ick contains foo_1.2-1.dsc
+ THEN the APT repository for foo.ick contains foo_1.2-1_all.deb
diff --git a/doc/900-implements.yarn b/doc/900-implements.yarn
index 3fc92c7..55fe8f1 100644
--- a/doc/900-implements.yarn
+++ b/doc/900-implements.yarn
@@ -22,7 +22,7 @@ repository has a branch.
Create a basic ick file. Add the state automatically.
IMPLEMENTS GIVEN an ick file (.+).ick
- printf "state: %s/%sstate\n" "$DATADIR" "$MATCH_1" \
+ printf "state: %s/%s.state\n" "$DATADIR" "$MATCH_1" \
> "$DATADIR/$MATCH_1.ick"
Add a target to an ick file.
@@ -62,16 +62,26 @@ Add build commands for a project in an ick file.
Run ick, capturing its output for later inspection.
IMPLEMENTS WHEN user runs ick (.+).ick
- "$SRCDIR/ick" --no-default-config \
- "$DATADIR/$MATCH_1.ick" > "$DATADIR/output"
+ if ! "$SRCDIR/ick" --no-default-config \
+ "$DATADIR/$MATCH_1.ick" \
+ > "$DATADIR/ick.stdout" 2> "$DATADIR/ick.stderr"
+ then
+ cat "$DATADIR/ick.stdout"
+ cat "$DATADIR/ick.stderr"
+ exit 1
+ fi
Inspect the captured output of the latest ick file.
IMPLEMENTS THEN ick output contains "(.+)"
- grep "$MATCH_1" "$DATADIR/output"
+ cat "$DATADIR/ick.stdout"
+ cat "$DATADIR/ick.stderr"
+ grep "$MATCH_1" "$DATADIR/ick.stdout"
IMPLEMENTS THEN ick output doesn't contain "(.+)"
- ! grep "$MATCH_1" "$DATADIR/output"
+ cat "$DATADIR/ick.stdout"
+ cat "$DATADIR/ick.stderr"
+ ! grep "$MATCH_1" "$DATADIR/ick.stdout"
## Creating a git repository
@@ -89,13 +99,20 @@ the master branch as well.
git add README
git commit -m "Add README"
+ printf '#!/bin/sh\necho hello, world\n' > hello
+ chmod +x hello
+ git add hello
+ git commit -m "Add hello"
+
mkdir debian
mkdir debian/source
echo '3.0 (quilt)' > debian/source/format
echo Public domain > debian/copyright
echo 9 > debian/compat
+ echo hello usr/bin > debian/install
dch --create --package "$MATCH_1" --newversion "$MATCH_2" \
"Initial version."
+ dch -r ''
cat << EOF > debian/control
Source: $MATCH_1
@@ -155,3 +172,13 @@ Does a file exist?
IMPLEMENTS THEN file (.+) exists
test -e "$DATADIR/$MATCH_1"
+
+## Checking for package files in the APT repository
+
+Does a file with a given basename exist in the APT repository's pool
+tree?
+
+ IMPLEMENTS THEN the APT repository for (.+)\.ick contains (.+)
+ find "$DATADIR/$MATCH_1.state"
+ find "$DATADIR/$MATCH_1.state/debian/pool" \
+ -type f -name "$MATCH_2" | grep .