~aittner/charms/+source/scalebot-jenkins:install-juju-from-snap

Last commit made on 2021-12-06
Get this branch:
git clone -b install-juju-from-snap https://git.launchpad.net/~aittner/charms/+source/scalebot-jenkins
Only Alexandre Erwin Ittner can upload to this branch. If you are Alexandre Erwin Ittner please log in for upload directions.

Branch merges

Branch information

Name:
install-juju-from-snap
Repository:
lp:~aittner/charms/+source/scalebot-jenkins

Recent commits

69b5009... by Alexandre Erwin Ittner

Install Juju client from Snap in the Jenkins container

Newer versions of the Juju client are distributed as Snaps only, so
update ScaleBot to use them.

Installation itself is just a matter of removing the Juju package and
its PPA from layer:apt and adding it to a layer:snap, however, some extra
changes are required to make this Juju work under the environment
provided by jenkins-charm: the $HOME/snap directory must be under /home,
so we also need a persistent bind-mount for jenkins home directory (while
keeping compatibility with jenkins-charm's use of /var/lib/jenkins. Juju
client also depends on the home directory being defined in /etc/passwd, so
we need to update this information there *after* some processes are already
running under user jenkins.

3f6b6dc... by dann frazier

Reapply jenkins-job-builder workaround on charm upgrade

The last charm release made some changes to the code we inject into
/etc/default/jenkins, but provided no mechanism to re-trigger the
injection. Add a hook to do it on charm upgrade.

ca0b8cf... by dann frazier

black automatic reformatting

9e19870... by dann frazier

Remove bashism in workaround for jenkins-job-builder crumb issue

LP: #1945834

9f1e40e... by dann frazier

Block unnecessary reactions when the charm is stopping

If a user removes the scalebot application (`juju remove-application`), juju
will trigger the stop hook. We provide a stop hook which destroys the lab
controller, freeing up resources in the cloud. However, the charm continues
to react to other events, which can lead to it *re*-bootstrapping a
controller. This can lead to orphaned resources in the cloud.

Introduce a new pair of states[*], "scalebot.go" and "scalebot.stop", which
are intended to be mutually exclusive. The charm will start out and remain
in the "scalebot.go" state until the stop hook is called, at which point
we'll transition to the "scalebot.stop" state. Add guards to prevent
various reactions from executing in "scalebot.stop".

[*] The "state" API has been apparently deprecated for a "flag" API for
    some time. We should switch over to the "flag" API - but I'll leave
    that for another time.

16ed2f5... by dann frazier

README.devel: Remind developers to tag the repo after pushing a new charm

e727b57... by Taihsiang Ho

Stop supporting Bionic

Bionic has python package dependency issue for scalebot. In the
meantime, the conflict is incompatible with Focal. Instead of supporting
both distrobutions, we decided to stop supporting Bionic and focusing on
Focal.

LP: #1920983 (private bug)

63bf06f... by Taihsiang Ho

Fix charm build warning of email information

This commit fixes this warning message:

proof: W: Maintainer format should be "Name <Email>", not
"<email address hidden>"

79a5200... by dann frazier

Fix typo and simplify log message

The main goal here is to correct spelling of "bootstrapping", but I also
decided to shorten the message because I'm not sure the second sentence
was adding to the first.

5f7aec1... by dann frazier

Fix reference-before-assignment issue

Seen in debug-log:

unit-scalebot-0: 12:01:15 WARNING unit.scalebot/0.stop UnboundLocalError: local variable 'modeldefaultsfile' referenced before assignment
unit-scalebot-0: 12:01:16 ERROR juju.worker.uniter.operation hook "stop" (via explicit, bespoke hook script) failed: exit status 1