Skip to content

Back port Jenkinsfile and associated changes to generator/build (3.21) - #3494

Merged
craigcomstock merged 1 commit into
cfengine:3.21from
craigcomstock:3.21
Sep 3, 2025
Merged

Back port Jenkinsfile and associated changes to generator/build (3.21)#3494
craigcomstock merged 1 commit into
cfengine:3.21from
craigcomstock:3.21

Conversation

@craigcomstock

Copy link
Copy Markdown
Contributor

Ticket: ENT-12581
Changelog: none

@cf-bottom

Copy link
Copy Markdown

Thank you for submitting a pull request! Maybe @nickanderson can review this?

@craigcomstock

Copy link
Copy Markdown
Contributor Author

almost done here, just need to double-check and squash commits :)

USER jenkins
WORKDIR /home/jenkins
RUN bash -x /install.sh
RUN bash -x /install.sh 2>&1 | tee /install.sh.log

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread generator/build/main.sh
fi

echo "$(basename "$0"): Diagnostic facts about execution environment:"
echo "======"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment thread generator/build/main.sh
else
_VERSION="$BRANCH" # in case someone copy/pastes this to a repo besides documentation
fi
cf-remote --version "$_VERSION" download "${ID}$(echo "${VERSION_ID}" | cut -d. -f1)" hub "$(uname -m)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

Comment thread generator/build/main.sh
find "$HOME/.cfengine" -name '*.deb' -print0 | xargs -0 -I{} cp {} cfengine-nova-hub.deb
else
echo "Installing with old-style fetch_file function"
HUB_DIR_NAME=PACKAGES_HUB_x86_64_linux_ubuntu_22

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ubuntu and 22 here come from os_release vars?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, this part is the as-is/as-was portion so left the same. It could.

Comment thread generator/build/main.sh

# unpack
# we unpack the hub package instead of installing to get around trouble with the package trying to start up services in a container which doesn't work all that well (yet, 2025)
sudo dpkg --unpack cfengine-nova-hub.deb

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯 TIL

Comment thread generator/build/main.sh
sudo dpkg --unpack cfengine-nova-hub.deb
rm cfengine-nova-hub.deb

# TODO: why copy the masterfiles from the package over the top of one we checked out which could have changes from a PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that wouldn't seem to make sense.

Comment thread generator/build/run.sh
# These env vars must be defined:
true "${BRANCH?undefined}"
# The PACKAGE* vars are not needed for fast-build jobs as they use cf-remote --version $BRANCH install
# We still require them to have a value but by current convention (until cf-remote --version testing-pr-build-number works) we set them to cf-remote in documentation/Jenkinsfile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's going to be nice.

Comment thread generator/build/run.sh
c=$(buildah from -v "$PWD":/nt docs-revamp-22)
# figure out BRANCH from jenkins environment variables
if [ -n "$PR_BASE" ]; then
# PR_BASE comes from documentation/Jenkinsfile and ${pullRequest.base}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for examples.

Comment thread generator/build/run.sh
BRANCH="$PR_BASE"
elif [ -n "$BRANCH_NAME" ]; then
# jenkins, for pull requests this will be e.g. PR-<number> so not used
# for non-pull reqeusts this will be master, 3.24.x, etc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Some diffs are present between master (hugo) and 3.21/3.24 (jekyll still).

Ticket: ENT-12581
Changelog: none
@craigcomstock
craigcomstock marked this pull request as ready for review September 3, 2025 20:22
@craigcomstock
craigcomstock merged commit 6c390d6 into cfengine:3.21 Sep 3, 2025
1 check passed
@craigcomstock
craigcomstock deleted the 3.21 branch September 3, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants