Skip to content

Only lint in install/kots:lint if env vars are set#13218

Merged
roboquat merged 1 commit into
mainfrom
mads/only-lint-if-envs-are-set
Sep 23, 2022
Merged

Only lint in install/kots:lint if env vars are set#13218
roboquat merged 1 commit into
mainfrom
mads/only-lint-if-envs-are-set

Conversation

@mads-hartmann

Copy link
Copy Markdown
Contributor

Description

I'm trying to make it easier to run a full leeway build from a Gitpod workspace in https://github.com/gitpod-io/ops/issues/5411. This PR sets default values for REPLICATED_API_TOKEN and REPLICATED_APP to be the empty string and changes install/kots:lint such that it will skip linting if the values are not set.

Related Issue(s)

Part of https://github.com/gitpod-io/ops/issues/5411

How to test

With this change you can run leeway build install/kots:lint and it will skip the linting which means the package builds:

leeway build install/kots:lint
☁️  checking remote cache for past build artifacts
🔧  build  install/kots:lint  (version 797e97ea2f4b8781d619ecf20e14d2beff0da576)

[install/kots:lint] build started (version 797e97ea2f4b8781d619ecf20e14d2beff0da576)
[install/kots:lint] Installing Helm dependencies
[install/kots:lint] Getting updates for unmanaged Helm repositories...
[install/kots:lint] ...Successfully got an update from the "https://fluent.github.io/helm-charts" chart repository
[install/kots:lint] Saving 1 charts
[install/kots:lint] Downloading fluent-bit from repo https://fluent.github.io/helm-charts
[install/kots:lint] Deleting outdated charts
[install/kots:lint] Successfully packaged chart and saved it to: ../../manifests/fluent-bit-0.20.2.tgz
[install/kots:lint] /tmp/build/install-kots--lint.797e97ea2f4b8781d619ecf20e14d2beff0da576
[install/kots:lint] REPLICATED_API_TOKEN and REPLICATED_APP are not set. Skipping
[install/kots:lint] package build succeded (0.55s)
☁️  uploading build artifacts to remote cache

build succeded

If you specify the build args then it will try to lint (but fail, as I don't have the right credentials)

leeway build install/kots:lint -DREPLICATED_API_TOKEN="a" -DREPLICATED_APP="b"
☁️  checking remote cache for past build artifacts
🔧  build  install/kots:lint  (version bb4493b88597d7cba568f0b1a6a9df10efd2cd14)

[install/kots:lint] build started (version bb4493b88597d7cba568f0b1a6a9df10efd2cd14)
[install/kots:lint] Installing Helm dependencies
[install/kots:lint] Getting updates for unmanaged Helm repositories...
[install/kots:lint] ...Successfully got an update from the "https://fluent.github.io/helm-charts" chart repository
[install/kots:lint] Saving 1 charts
[install/kots:lint] Downloading fluent-bit from repo https://fluent.github.io/helm-charts
[install/kots:lint] Deleting outdated charts
[install/kots:lint] Successfully packaged chart and saved it to: ../../manifests/fluent-bit-0.20.2.tgz
[install/kots:lint] /tmp/build/install-kots--lint.bb4493b88597d7cba568f0b1a6a9df10efd2cd14
[install/kots:lint] Error: list channels: GET https://api.replicated.com/vendor/v3/apps 401: 
[install/kots:lint] make: *** [Makefile:65: lint] Error 1
[install/kots:lint] package build failed
[install/kots:lint] Reason: exit status 2
☁️  uploading build artifacts to remote cache
build failed
Reason: build failed
FATA[0005] build failed     

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@mads-hartmann
mads-hartmann requested a review from a team September 22, 2022 20:00
@github-actions github-actions Bot added the team: delivery Issue belongs to the self-hosted team label Sep 22, 2022
@roboquat
roboquat merged commit 4d72ae0 into main Sep 23, 2022
@roboquat
roboquat deleted the mads/only-lint-if-envs-are-set branch September 23, 2022 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none size/S team: delivery Issue belongs to the self-hosted team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants