[yocto] [autobuilder][PATCH] config: support configuration templates

Joe MacDonald joe_macdonald at mentor.com
Tue Feb 17 18:53:27 PST 2015


I intended to --annotate the patch and include the [autobuilder] tag
before git-send-email ran off with it on me.  Sorry about that.

I'm sending this separately, based on the master HEAD commit, from my
documentation patches since I recognize the benefit of this may be
less obvious and maybe it's not a change upstream actually wants.  I
have one more change ready to send, supporting parallel alternate
configurations for the controller and worker, but without this change,
the next doesn't make much sense, so I thought I'd see what the
thoughts are on this change first.

On Tue, Feb 17, 2015 at 9:51 PM, Joe MacDonald <joe_macdonald at mentor.com> wrote:
> Move yocto-controller and yocto-worker to .template versions and update
> the setup script to move them in the expected location if they aren't
> already preset, allowing local configurations to make whatever changes
> they need in the yocto-[controller|worker] directories without issues on a
> pull and without having to resort to tools like git-diff and git-checkout
> to try alternate configurations.
>
> Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
> ---
>  .gitignore                                         |  14 ++------
>  yocto-autobuilder-setup                            |  37 +++++++++++++++++++++
>  .../Makefile                                       |   0
>  .../buildbot.tac.example                           |   0
>  .../buildbot.tac.standard                          |   0
>  .../controller.cfg.example                         |   0
>  .../public_html/bg_gradient.jpg                    | Bin
>  .../public_html/default.css                        |   0
>  .../public_html/favicon.ico                        | Bin
>  .../public_html/robots.txt                         |   0
>  .../templates/README.txt                           |   0
>  .../yoctoABConfig.py                               |   0
>  {yocto-worker => yocto-worker.template}/Makefile   |   0
>  .../buildbot.tac.example                           |   0
>  14 files changed, 39 insertions(+), 12 deletions(-)
>  rename {yocto-controller => yocto-controller.template}/Makefile (100%)
>  rename {yocto-controller => yocto-controller.template}/buildbot.tac.example (100%)
>  rename {yocto-controller => yocto-controller.template}/buildbot.tac.standard (100%)
>  rename {yocto-controller => yocto-controller.template}/controller.cfg.example (100%)
>  rename {yocto-controller => yocto-controller.template}/public_html/bg_gradient.jpg (100%)
>  rename {yocto-controller => yocto-controller.template}/public_html/default.css (100%)
>  rename {yocto-controller => yocto-controller.template}/public_html/favicon.ico (100%)
>  rename {yocto-controller => yocto-controller.template}/public_html/robots.txt (100%)
>  rename {yocto-controller => yocto-controller.template}/templates/README.txt (100%)
>  rename {yocto-controller => yocto-controller.template}/yoctoABConfig.py (100%)
>  rename {yocto-worker => yocto-worker.template}/Makefile (100%)
>  rename {yocto-worker => yocto-worker.template}/buildbot.tac.example (100%)
>
> diff --git a/.gitignore b/.gitignore
> index f1f9e4e..017636f 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -15,15 +15,5 @@
>  .cfg
>
>  TODO
> -yocto-controller/http.log
> -yocto-controller/controller.cfg
> -yocto-controller/state.sqlite
> -yocto-controller/twistd.log*
> -yocto-controller/buildbot.tac
> -yocto-worker/build-appliance/build(newcommits)
> -yocto-worker/buildbot.tac
> -yocto-worker/nightly-x86/.buildbot-sourcedata-YnVpbGQ=
> -yocto-worker/nightly/build(newcommits)
> -yocto-worker/twistd.hostname
> -yocto-worker/twistd.log*
> -yocto-worker/twistd.pid
> +yocto-controller
> +yocto-worker
> diff --git a/yocto-autobuilder-setup b/yocto-autobuilder-setup
> index 615deb4..8d447f7 100644
> --- a/yocto-autobuilder-setup
> +++ b/yocto-autobuilder-setup
> @@ -62,6 +62,25 @@ export OGIT_TRASH_CRON_TIME="0 0 * * *"
>  export OGIT_TRASH_NICE_LEVEL="19"
>  HOST_ADDR=$(hostname -I)
>
> +#########################################
> +#
> +# Create a new controller/worker configuation based on our templates if we don't
> +# already have one configured here.
> +#
> +#########################################
> +if [ ! -d "${PWD}/yocto-controller" ]; then
> +    echo ""
> +    echo "Creating yocto-controller/ from yocto-controller.template/"
> +    echo ""
> +    /bin/cp -R yocto-controller.template yocto-controller
> +fi
> +if [ ! -d "${PWD}/yocto-worker" ]; then
> +    echo ""
> +    echo "Creating yocto-worker/ from yocto-worker.template/"
> +    echo ""
> +    /bin/cp -R yocto-worker.template yocto-worker
> +fi
> +
>  ##########################
>  #
>  # Check to see if we've got a username/password set
> @@ -129,6 +148,24 @@ if [  ! -d  "./buildset-config" ]; then
>      /bin/cp -R buildset-config.controller buildset-config
>  fi
>
> +#########################################
> +#
> +# If there is already a state.sqlite file in the controller directory, it may
> +# need upgrading.  Inform the user about this.  This command is run
> +# automatically the first time it is run on a pristine configuration.  See
> +# below.
> +#
> +#########################################
> +if [ -f ]; then
> +    echo ""
> +    echo "An existing yocto-controller/state.sqlite has been found."
> +    echo "If you have changed your configuration since the last time"
> +    echo "you sourced this setup script, you will most likely need to"
> +    echo "update it.  The command you probably want is:"
> +    echo ""
> +    echo "\tbuildbot upgrade-master ${PWD}/yocto-controller"
> +    echo ""
> +fi
>
>  if [ -n "${config_check:+x}" ]; then
>      echo ""
> diff --git a/yocto-controller/Makefile b/yocto-controller.template/Makefile
> similarity index 100%
> rename from yocto-controller/Makefile
> rename to yocto-controller.template/Makefile
> diff --git a/yocto-controller/buildbot.tac.example b/yocto-controller.template/buildbot.tac.example
> similarity index 100%
> rename from yocto-controller/buildbot.tac.example
> rename to yocto-controller.template/buildbot.tac.example
> diff --git a/yocto-controller/buildbot.tac.standard b/yocto-controller.template/buildbot.tac.standard
> similarity index 100%
> rename from yocto-controller/buildbot.tac.standard
> rename to yocto-controller.template/buildbot.tac.standard
> diff --git a/yocto-controller/controller.cfg.example b/yocto-controller.template/controller.cfg.example
> similarity index 100%
> rename from yocto-controller/controller.cfg.example
> rename to yocto-controller.template/controller.cfg.example
> diff --git a/yocto-controller/public_html/bg_gradient.jpg b/yocto-controller.template/public_html/bg_gradient.jpg
> similarity index 100%
> rename from yocto-controller/public_html/bg_gradient.jpg
> rename to yocto-controller.template/public_html/bg_gradient.jpg
> diff --git a/yocto-controller/public_html/default.css b/yocto-controller.template/public_html/default.css
> similarity index 100%
> rename from yocto-controller/public_html/default.css
> rename to yocto-controller.template/public_html/default.css
> diff --git a/yocto-controller/public_html/favicon.ico b/yocto-controller.template/public_html/favicon.ico
> similarity index 100%
> rename from yocto-controller/public_html/favicon.ico
> rename to yocto-controller.template/public_html/favicon.ico
> diff --git a/yocto-controller/public_html/robots.txt b/yocto-controller.template/public_html/robots.txt
> similarity index 100%
> rename from yocto-controller/public_html/robots.txt
> rename to yocto-controller.template/public_html/robots.txt
> diff --git a/yocto-controller/templates/README.txt b/yocto-controller.template/templates/README.txt
> similarity index 100%
> rename from yocto-controller/templates/README.txt
> rename to yocto-controller.template/templates/README.txt
> diff --git a/yocto-controller/yoctoABConfig.py b/yocto-controller.template/yoctoABConfig.py
> similarity index 100%
> rename from yocto-controller/yoctoABConfig.py
> rename to yocto-controller.template/yoctoABConfig.py
> diff --git a/yocto-worker/Makefile b/yocto-worker.template/Makefile
> similarity index 100%
> rename from yocto-worker/Makefile
> rename to yocto-worker.template/Makefile
> diff --git a/yocto-worker/buildbot.tac.example b/yocto-worker.template/buildbot.tac.example
> similarity index 100%
> rename from yocto-worker/buildbot.tac.example
> rename to yocto-worker.template/buildbot.tac.example
> --
> 1.9.1
>



More information about the yocto mailing list