Skip to content

Commit

Permalink
fix(docs): make sure we can build the example rockcraft.yaml
Browse files Browse the repository at this point in the history
Put the example code in a spread test, to ensure that we can always
build the example we give in the docs.

Fixes #399
  • Loading branch information
tigarmo committed Nov 3, 2023
1 parent b4dc8f1 commit e7e3091
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 36 deletions.
32 changes: 32 additions & 0 deletions docs/reference/code/example/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: hello
title: Hello World
summary: An Hello World ROCK
description: |
This is just an example of a Rockcraft project
for a Hello World ROCK.
version: latest
base: bare
build-base: [email protected]
license: Apache-2.0
run-user: _daemon_
environment:
FOO: bar
services:
hello:
override: replace
command: /usr/bin/hello -t
environment:
VAR1: value
VAR2: "other value"
platforms:
amd64:
armhf:
build-on: ["armhf", "arm64"]
ibm:
build-on: ["s390x"]
build-for: s390x
parts:
hello:
plugin: nil
stage-packages:
- hello
8 changes: 8 additions & 0 deletions docs/reference/code/example/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

summary: Check that we can build the example rockcraft.yaml

execute: |
rockcraft pack
restore: |
rm -f ./*.rock
37 changes: 2 additions & 35 deletions docs/reference/rockcraft.yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,41 +223,8 @@ The set of parts that compose the ROCK's contents
Example
=======

.. code-block:: yaml
name: hello
title: Hello World
summary: An Hello World ROCK
description: |
This is just an example of a Rockcraft project
for a Hello World ROCK.
version: latest
base: bare
build-base: [email protected]
license: Apache-2.0
run-user: _daemon_
environment:
FOO: bar
services:
hello:
override: replace
command: /usr/bin/hello -t
environment:
VAR1: value
VAR2: "other value"
platforms:
amd64:
arm:
build-on: ["arm", "arm64"]
ibm:
build-on: ["s390x"]
build-for: s390x
parts:
hello:
plugin: nil
stage-packages:
- hello
.. literalinclude:: code/example/rockcraft.yaml
:language: yaml


.. _`Pebble Layer Specification format`: https://github.com/canonical/pebble#layer-specification
2 changes: 1 addition & 1 deletion docs/tutorials/code/node-app/task.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

summary: donejs tutorial
summary: nodejs tutorial

execute: |
# [docs:install-rockcraft]
Expand Down
3 changes: 3 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ suites:
systems:
- ubuntu-22.04-64

docs/reference/code/:
summary: tests reference code from the docs

tests/spread/general/:
summary: tests for rockcraft core functionality

Expand Down

0 comments on commit e7e3091

Please sign in to comment.