~dannf/charms/+source/scalebot-jenkins:symlink-jujud

Last commit made on 2022-04-12
Get this branch:
git clone -b symlink-jujud https://git.launchpad.net/~dannf/charms/+source/scalebot-jenkins
Only dann frazier can upload to this branch. If you are dann frazier please log in for upload directions.

Branch information

Name:
symlink-jujud
Repository:
lp:~dannf/charms/+source/scalebot-jenkins

Recent commits

a8bb902... by dann frazier

symlink the juju snap's jujud binary into /usr/local/bin

juju apparently needs to be in the user's $PATH in order to bootstrap
a new controller:

unit-scalebot-0: 21:57:24 ERROR unit.scalebot/0.juju-log Fail to bootstrap a controller. It may be because: Failed for: failed to acquire node: No available machine matches constraints.
unit-scalebot-0: 21:57:25 WARNING unit.scalebot/0.update-status ERROR No controllers registered.
unit-scalebot-0: 21:57:25 WARNING unit.scalebot/0.update-status
unit-scalebot-0: 21:57:25 WARNING unit.scalebot/0.update-status Please either create a new controller using "juju bootstrap" or connect to
unit-scalebot-0: 21:57:25 WARNING unit.scalebot/0.update-status another controller that you have been given access to using "juju register".
unit-scalebot-0: 21:57:25 WARNING unit.scalebot/0.update-status
unit-scalebot-0: 21:57:25 INFO unit.scalebot/0.juju-log Invoking reactive handler: reactive/scalebot-jenkins.py:471:scalebot_start
unit-scalebot-0: 21:57:25 INFO unit.scalebot/0.juju-log Invoking reactive handler: reactive/apt.py:50:ensure_package_status
unit-scalebot-0: 21:57:25 INFO unit.scalebot/0.juju-log status-set: blocked: Fail to bootstrap a controller. It may be because: Failed for: failed to acquire node: No available machine matches constraints.
unit-scalebot-0: 21:57:25 INFO juju.worker.uniter.operation ran "update-status" hook (via explicit, bespoke hook script)

6cbf470... by dann frazier

Don't fail if systemd override directory already exists

Fixes this issue I saw after a charm upgrade:

unit-scalebot-1: 15:33:45 ERROR unit.scalebot/1.juju-log Hook error:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/usr/local/lib/python3.8/dist-packages/charms/reactive/bus.py", line 379, in dispatch
    _invoke(hook_handlers)
  File "/usr/local/lib/python3.8/dist-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/usr/local/lib/python3.8/dist-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-scalebot-1/charm/reactive/scalebot-jenkins.py", line 114, in configure_scalebot_env
    os.makedirs(unit_override_dir)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/etc/systemd/system/jenkins.service.d'

a03f775... by dann frazier

README.devel: Add a "tag the source" step

98cae05... by dann frazier

Install juju from the snap, but execute it without the snap wrapper

Cut & pasting of the included comment:

    New versions of juju are only distributed as a snap, but the jenkins
    charm doesn't support running juju from a snap:
      https://github.com/jenkinsci/jenkins-charm/issues/59
    Let's install juju via the snap, but purely as a way to get the juju
    binary onto the system. Instead of executing it through the snap wrapper
    (/snap/bin/juju), we install a symlink to the juju binary itself
    (/snap/juju/current/bin/juju) into /usr/local/bin. /usr/local/bin
    precedes the /snap/bin wrapper in $PATH. This method allows us to run
    it without any of the snap confinement.

LP: #1965450

cae6fd2... by dann frazier

Remove the crumb workaround insertion for initscript-based jenkins installs

With this we can no longer support Jenkins debs prior to 2.335 where
they migrated to systemd. Doing so lets us get rid of an ugly hack
that will otherwise likely bit-rot.

6509d49... by dann frazier

Add support for the Crumb workaround when using systemd

We don't need to preserve and append to an existing $JAVA_ARGS here because
the jenkins package now correctly uses $JAVA_OPTS for JVM settings.

c7437ca... by dann frazier

Add support for setting Jenkins environment variables with systemd

Jenkins switched from using an initscript to a systemd unit in 2.335.

We need to keep the /etc/profile.d support as well for scripts that
run outside of jenkins, e.g. `pull-and-reload-jobs`.

LP: #1965340

6e1054f... by dann frazier

black automatic reformatting

5a27b2f... by Patricia Domingues

charmcraft: update readme.devel

changing info how we can now release our charm to charmhub.io via charmcraft

dd09dcf... by Patricia Domingues

charmcraft change name to be able to upload the charm