Skip to content
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

[kots]: configure werft build command #8867

Merged
merged 3 commits into from
Mar 28, 2022
Merged

[kots]: configure werft build command #8867

merged 3 commits into from
Mar 28, 2022

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Mar 17, 2022

Description

Automate the KOTS process.

  1. Runs make lint on the manifests during the build phase. Although this is far from perfect, it's a good indication if there are any problems in the manifests. As per the guidelines, warnings and below return successful. The replicated lint command requires the REPLICATED_APP and REPLICATED_API_TOKEN envvars being set. This is a bug in the system
  2. Whenever a main build is successful, updates the gitpod-installer-job.yaml image tag and pushes to gitpod/unstable channel in Replicated.

Related Issue(s)

Fixes #8866

How to test

See release 20 as a demo of the replicated release create command working on any branch and then release 21 of it being wrapped in the if mainBranch conditional

And here's proof that the release to Replicated works

image

Release Notes

[kots]: configure werft build command

Documentation

@mrsimonemms mrsimonemms force-pushed the sje/kots-release branch 7 times, most recently from 07bca44 to 377a00b Compare March 18, 2022 09:39
@mrsimonemms mrsimonemms force-pushed the sje/kots-release branch 2 times, most recently from aba2179 to de6c6c2 Compare March 18, 2022 09:44
When a build is run on the main branch, it publishes the latest
release to the unstable channel in KOTS.
@mrsimonemms mrsimonemms marked this pull request as ready for review March 18, 2022 10:05
@mrsimonemms mrsimonemms requested a review from a team March 18, 2022 10:05
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label Mar 18, 2022
@mrsimonemms mrsimonemms changed the title WIP: [kots]: configure werft build command [kots]: configure werft build command Mar 18, 2022
Copy link
Contributor

@Pothulapati Pothulapati left a comment

Choose a reason for hiding this comment

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

Awesome Work, @mrsimonemms! This should be really great for testing.

I don't have experience working with werft but I see that we did the following, to publish automatic unstable kots releases on main, and perform lint for builds

  • Create a new build job in publish-kots-unstable that is toggled only if its a main job! As this performs the publishing.
  • For the above job to work, we need the relevant env variables that we seem to have created K8s secrets for, and attach them as variables which are then passed to the job in build-and-publish.ts
  • Update BUILD.yaml to include the lint action which we probably use for CI PR builds. (So, the required env variables are automatically passed here as they are on the same k8s cluster?)

/hold to get a @corneliusludmann review just to make sure that we aren't missing any of the werft stuff that I am not aware of!

Copy link
Contributor

@corneliusludmann corneliusludmann left a comment

Choose a reason for hiding this comment

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

Looks good to me as well. The comment I left is more a nit. Feel free to ignore or add a small follow-up PR. Nothing that should prevent us from merging this.

Probably a good idea if that person that removes the hold label has an eye on the main build to fix it in case we break it with this change.

By the way: I was wondering why the MIT license is used for these files. Maybe we need to figure out if this is really what we want. Most of our stuff is under AGPL and not MIT.

// Set the tag to the current version
exec(`yq w -i ${REPLICATED_YAML_DIR}/gitpod-installer-job.yaml ${INSTALLER_JOB_IMAGE} ${image}:${config.version}`);

const app = exec(`kubectl get secret ${REPLICATED_SECRET} --namespace werft -o jsonpath='{.data.app}' | base64 -d`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be easier to just use process.env.REPLICATED_API_TOKEN and process.env.REPLICATED_APP instead?

@mrsimonemms
Copy link
Contributor Author

Looks good to me as well. The comment I left is more a nit. Feel free to ignore or add a small follow-up PR. Nothing that should prevent us from merging this.

I'll do a follow-up PR. It hadn't occurred to me at the time.

By the way: I was wondering why the MIT license is used for these files. Maybe we need to figure out if this is really what we want. Most of our stuff is under AGPL and not MIT.

I just used the leeway command to generate the license statement. I'll have a look into this and do a follow-up PR if necessary

@mrsimonemms
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 543bcac into main Mar 28, 2022
@roboquat roboquat deleted the sje/kots-release branch March 28, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/L team: delivery Issue belongs to the self-hosted team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a werft job to automatically push main releases to gitpod/unstable channel
4 participants