configuration-as-code-plugin: Resource root URL not shown on a Jenkins docker container run

  • [ x] Jenkins version: Jenkins ver. 2.222.3

  • [x ] Plugin version: configuration-as-code 1.40

  • [x ] OS Ubuntu 16.04.6 LTS

Description

I am running a jenkins container with configuration as a code plugin in my linux machine. It is based from a docker image FROM jenkins/jenkins:lts

I configured Resource root URL under Serve resource files from another domain under Jenkins (http://localhost:8080/configure)

I defined Resource root URL on the casc yml file like this under

unclassified:
  resourceRoot:
    url: "http://127.0.0.1:8080/"

Once the I run the container, the link url doesn’t show in the GUI. My workaround is to reload manually the casc configuration yml at http://localhost:8080/configuration-as-code/ which works fine. This is not a good solution during automation.

How do we solve this issue that once the container runs, the root url should expectedly be shown? image

It seems strange because when building the image, no issues are found and I am quite sure I followed the casc rule definition.

Thank you for your help.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (18 by maintainers)

Most upvoted comments

Tested with https://github.com/jetersen/jenkins4casc And it definitely works!

I have a few prs that I would like to land

Any url-safe random string will work, the helm chart just uses the pod name for it: https://github.com/helm/charts/blob/master/stable/jenkins/templates/jenkins-master-deployment.yaml#L325

I think I have a fix for the ordinal sorting. That way Location should be applied before resourceRoot

Before: image

After: image

       Comparator<Attribute<T,?>> attributeComparator = Comparator.comparingDouble(a -> {
            Annotation annotation = a.type.getAnnotation(Extension.class);
            if (annotation == null)
                return Double.MIN_VALUE;
            Extension extension = (Extension) annotation;
            return extension.ordinal();
        });