Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

mads-hartmann
Copy link
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