Enable installing nimble siblings
Change-Id: I58f7b3038bd8239d5f04f66a18aad56ec77dad7d
This commit is contained in:
parent
5b3a48e73b
commit
49b06e31de
@ -10,7 +10,22 @@ Run nimble command in a source directory. Assumes the appropriate version of nim
|
||||
|
||||
.. zuul:rolevar:: nim_path
|
||||
|
||||
Path where nim and nimble are installed.
|
||||
Path to a directory where nim and nimble are installed.
|
||||
|
||||
.. zuul:rolevar:: nimble_use_siblings
|
||||
:type: bool
|
||||
:default: true
|
||||
|
||||
Whether to configure nimble to build with siblings or not.
|
||||
|
||||
.. zuul:rolevar:: nimble_siblings
|
||||
:type: list
|
||||
|
||||
List of paths to directories containing nim projects to
|
||||
configure nimble with ``nimble develop``. The projects
|
||||
have to be managed by nimble and contain a ``.nimble``
|
||||
file. By default this role will try to configure any
|
||||
repos made available with ``job.required-projects``.
|
||||
|
||||
.. zuul:rolevar:: zuul_work_dir
|
||||
:default: {{ zuul.project.src_dir }}
|
||||
|
@ -1,2 +1,5 @@
|
||||
nimble_command: build
|
||||
nimble_use_siblings: true
|
||||
nimble_siblings: "{{ zuul.projects.values() | selectattr('required') | map(attribute='src_dir') | list }}"
|
||||
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
||||
|
||||
|
@ -1,3 +1,14 @@
|
||||
- name: Configure siblings
|
||||
when: nimble_use_siblings
|
||||
command: nimble develop
|
||||
environment:
|
||||
PATH: "{{ nim_path }}:{{ ansible_env.PATH }}"
|
||||
args:
|
||||
chdir: "{{ zj_nimble_siblings }}"
|
||||
loop: "{{ nimble_siblings }}"
|
||||
loop_control:
|
||||
loop_var: zj_nimble_siblings
|
||||
|
||||
- name: Run nimble
|
||||
command: "nimble {{ nimble_command }} --accept"
|
||||
args:
|
||||
|
12
test-playbooks/nimble/sibling/sibling.nimble
Normal file
12
test-playbooks/nimble/sibling/sibling.nimble
Normal file
@ -0,0 +1,12 @@
|
||||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "Albin Vass"
|
||||
description = "A new awesome nimble package"
|
||||
license = "MIT"
|
||||
srcDir = "src"
|
||||
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 1.4.2"
|
2
test-playbooks/nimble/sibling/src/sibling.nim
Normal file
2
test-playbooks/nimble/sibling/src/sibling.nim
Normal file
@ -0,0 +1,2 @@
|
||||
proc helloWorld*() =
|
||||
echo "Hello world!"
|
@ -1 +1,3 @@
|
||||
echo "Hello world!"
|
||||
import sibling
|
||||
|
||||
helloWorld()
|
||||
|
@ -11,3 +11,4 @@ bin = @["test"]
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 1.4.0"
|
||||
requires "sibling"
|
||||
|
@ -10,6 +10,8 @@
|
||||
- test-playbooks/nimble
|
||||
vars:
|
||||
zuul_work_dir: '{{ zuul.project.src_dir }}/test-playbooks/nimble'
|
||||
nimble_siblings:
|
||||
- '{{ zuul.project.src_dir }}/test-playbooks/nimble/sibling'
|
||||
|
||||
- job:
|
||||
name: zuul-jobs-test-nimble-centos-7
|
||||
|
Loading…
Reference in New Issue
Block a user