canonical-ubuntu-qa team mailing list archive
-
canonical-ubuntu-qa team
-
Mailing list archive
-
Message #00545
Re: [Merge] ~andersson123/qa-jenkins-jobs:daily_charmcraft_build into qa-jenkins-jobs:master
Review: Needs Fixing
Diff comments:
> diff --git a/jobs/autopkgtest-cloud/jobs.yaml b/jobs/autopkgtest-cloud/jobs.yaml
> index c71fea4..1cca695 100644
> --- a/jobs/autopkgtest-cloud/jobs.yaml
> +++ b/jobs/autopkgtest-cloud/jobs.yaml
> @@ -15,6 +15,41 @@
> # You should have received a copy of the GNU General Public License along
> # with this program. If not, see <http://www.gnu.org/licenses/>.
>
> +- job:
> + name: autopkgtest-cloud-daily-charmcraft-pack-check
> + description: |
> + Runs a daily charmcraft pack for autopkgtest-cloud-worker and
> + autopkgtest-web charms to check for changes in external
> + dependencies breaking the charms.
> + node: 'venonat'
> + triggers:
> + - timed: '@daily'
> + builders:
> + - clear-artifacts:
> + - shell: |
> + #!/bin/bash
> + set -ex
> + export http_proxy="http://squid.internal:3128"
> + export https_proxy="http://squid.internal:3128"
> + export no_proxy=launchpad.net
> + this_dir=$(mktemp -d)
> + cd "${this_dir}"
There is no need to setup a temp dir: Jenkins job runs already happen in a dedicated directory setup by Jenkins for the job. You can see it in the console log of every Jenkins job run:
Building remotely on ... (iso-testing-amd64 iso-testing venonat) in workspace /PATH/TO/WORKSPACE
During the job run that's in the $WORKSPACE env var.
> +
> + git clone --depth 1 https://git.launchpad.net/autopkgtest-cloud
> + cd autopkgtest-cloud
> + printf "Building charms...\n"
> + charmcraft pack -v -p charms/focal/autopkgtest-cloud-worker/
> + charmcraft pack -v -p charms/focal/autopkgtest-web/
> + if test -f "autopkgtest-cloud-worker_ubuntu-20.04-amd64.charm" && test -f "autopkgtest-web_ubuntu-20.04-amd64.charm"; then
> + printf "Charms built successfully\n"
> + else
> + printf "Charms didn't build!\n"
We need something like an `exit 1` here, otherwise this check won't make the job fail.
> + fi
> + rm autopkgtest-cloud-worker_ubuntu-20.04-amd64.charm
> + rm autopkgtest-web_ubuntu-20.04-amd64.charm
> + cd ..
> + rm -r autopkgtest-cloud/
No need to run this cleanup, let's leave the workspace as it is. If it fails it's easier to investigate what happened by just SSHing into the machine and checking what's in the workspace.
> +
Extra newline?
>
> - job:
> name: autopkgtest-cloud-rtd-build-trigger
--
https://code.launchpad.net/~andersson123/qa-jenkins-jobs/+git/qa-jenkins-jobs/+merge/444059
Your team Canonical Platform QA Team is subscribed to branch qa-jenkins-jobs:master.
References