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

Preview environments w/ Okteto #773

Merged
merged 10 commits into from
Dec 5, 2022
Merged

Preview environments w/ Okteto #773

merged 10 commits into from
Dec 5, 2022

Conversation

bttf
Copy link
Contributor

@bttf bttf commented Dec 1, 2022

Using Okteto Cloud to power preview environments via GitHub Actions

Once merged these changes should enable preview environments for all feature branches pushed to the repo moving forward

For the time being, it's running under my free-tier Okteto account which should be sufficient for now (but still under test for use across the team)

@bttf bttf force-pushed the AC/preview-environments-okteto branch from 5f1d3d0 to 97cbad6 Compare December 2, 2022 16:51
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

Your preview environment pr-773-bttf has been deployed.

Preview environment endpoints are available at:

@bttf bttf force-pushed the AC/preview-environments-okteto branch 11 times, most recently from 5c89d07 to a54416f Compare December 5, 2022 15:52
@bttf bttf force-pushed the AC/preview-environments-okteto branch from a54416f to 2176a2e Compare December 5, 2022 15:53
@bttf bttf force-pushed the AC/preview-environments-okteto branch from a69aba2 to 009893c Compare December 5, 2022 16:05
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: pr-${{ github.event.number }}-bttf
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okteto won't let preview environment names end in anything other than the Okteto's user's name, so in this case bttf has to be appended

@bttf bttf changed the title WIP - Preview environments w/ Okteto Preview environments w/ Okteto Dec 5, 2022
@bttf bttf marked this pull request as ready for review December 5, 2022 16:13
@bttf bttf requested review from a team and jdorn December 5, 2022 16:28
Dockerfile Outdated Show resolved Hide resolved
- APP_ORIGIN=https://growthbook-3000-${OKTETO_NAMESPACE}.cloud.okteto.net
- API_HOST=https://growthbook-3100-${OKTETO_NAMESPACE}.cloud.okteto.net
- JWT_SECRET=${JWT_SECRET}
- IS_CLOUD=true
Copy link
Member

Choose a reason for hiding this comment

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

wondering if there's a way to configure the env or specifically IS_CLOUD based on build parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm understanding correctly, I think that's pretty much what we're doing ... This docker compose file is where we configure the builds to be built by okteto

Copy link
Member

Choose a reason for hiding this comment

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

What I meant is letting the PR author (user) pass in some sort of env variable into the job / docker-compose file. For example, we could manually override the IS_CLOUD={true|false} or other properties. Something like this...
https://blog.geralexgr.com/github/parameters-and-variables-github-workflows

Anyhow don't let this block you, just an idea for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Makes sense, I did not know github allowed that for its workflows ... In any case, these defaults we've selected should work for the majority of cases ... Good to know we have this option for the future if we need it

@bttf bttf merged commit 063924a into main Dec 5, 2022
@bttf bttf deleted the AC/preview-environments-okteto branch December 5, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants