-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat(deps): Add devbox
config
#2914
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM jetpackio/devbox:latest | ||
|
||
# Installing your devbox project | ||
WORKDIR /code | ||
USER root:root | ||
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code | ||
USER ${DEVBOX_USER}:${DEVBOX_USER} | ||
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json | ||
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock | ||
|
||
|
||
# Step 6: Copying local flakes directories | ||
COPY local-flake local-flake | ||
COPY local-flake local-flake | ||
|
||
RUN devbox run -- echo "Installed Packages." | ||
|
||
RUN devbox shellenv --init-hook >> ~/.profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "Devbox Remote Container", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": ".." | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": {}, | ||
"extensions": [ | ||
"jetpack-io.devbox" | ||
] | ||
} | ||
}, | ||
"remoteUser": "devbox" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
strict_env | ||
if has nix | ||
then | ||
unset GOPATH # Required for editors to discover the go-tools in the flake. | ||
use flake | ||
layout ruby | ||
fi | ||
# Automatically sets up your devbox environment whenever you cd into this | ||
# directory via our direnv integration: | ||
|
||
eval "$(devbox generate direnv --print-envrc)" | ||
|
||
# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ | ||
# for more details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: "ASDF to Devbox dependency version sync" | ||
# This is only required until https://github.com/renovatebot/renovate/issues/27543 is resolved | ||
on: | ||
pull_request: | ||
paths: | ||
- ".tool-versions" | ||
jobs: | ||
asdf2devbox: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
# We potentially want to add at the end a commit by the author of the most recent | ||
# commit in this branch. However github has some protection which prevents workflows | ||
# to run in case a commit has been pushed with the default job-specific github-token. | ||
# For this case we need to use another one here. | ||
# | ||
# For more information, see: | ||
# <https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow> | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
token: ${{ secrets.APP_AUTOSCALER_CI_TOKEN }} # With push token that can trigger new PR jobs | ||
|
||
- name: Configure git | ||
id: configure_git | ||
shell: bash | ||
run: | | ||
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#! /usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
|
||
commit_author_name="$(git log -1 --pretty=format:'%an')" | ||
commit_author_email="$(git log -1 --pretty=format:'%ae')" | ||
commit_subject="$(git log -1 --pretty=format:'%s')" | ||
readonly commit_author_name commit_author_email commit_subject | ||
|
||
git config user.name "${commit_author_name}" | ||
git config user.email "${commit_author_email}" | ||
|
||
echo "commit_subject=${commit_subject}" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Install devbox | ||
uses: jetify-com/[email protected] | ||
with: | ||
enable-cache: 'true' | ||
|
||
- name: asdf2devbox.py | ||
shell: bash | ||
run: | | ||
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
silvestre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#! /usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
# We need the subsequent standard-message to determine if the last commit | ||
# has already cleaned up everything. In this case this workflow should not | ||
# change anything and we exit early. | ||
# An alternative would be to use a tag for this. But this does affect the whole | ||
# PR instead of just the latest commit. | ||
tidy_message='🤖🦾🛠️ scripts/asdf2devbox.py' | ||
readonly tidy_message | ||
|
||
commit_message='${{steps.configure_git.outputs.commit_subject}}' | ||
readonly commit_message | ||
|
||
if [[ "${commit_message}" == "${tidy_message}" ]] | ||
then | ||
echo 'This commit was by the asdf2devbox workflow! Exiting …' | ||
exit 0 | ||
fi | ||
|
||
devbox run scripts/asdf2devbox.py | ||
|
||
num_changed_files="$(git status --porcelain | wc --lines)" | ||
declare -i -r num_changed_files | ||
if ((num_changed_files > 0)) | ||
then | ||
echo 'Changes to some files were necessary!' | ||
git add . | ||
git commit --message="${tidy_message}" | ||
git push origin "HEAD:${GITHUB_HEAD_REF}" | ||
else | ||
echo 'No files changed!' | ||
fi | ||
echo '🏁' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"packages": [ | ||
"path:local-flake#bosh-bootloader", | ||
"path:local-flake#app-autoscaler-cli-plugin", | ||
"credhub-cli@latest", | ||
"delve@latest", | ||
"gh@latest", | ||
"go-tools@latest", | ||
"gopls@latest", | ||
"nodejs@latest", | ||
"nodePackages.yaml-language-server@latest", | ||
"rubocop@latest", | ||
"rubyPackages.solargraph@latest", | ||
"swagger-cli@latest", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"pre-commit@latest", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"which@latest", | ||
"jq@latest", | ||
"[email protected]", | ||
"python@latest", | ||
"act@latest", | ||
"[email protected]", | ||
"google-cloud-sdk@latest", | ||
"ginkgo@latest", | ||
"temurin-bin-17@latest", | ||
"ruby@latest", | ||
"[email protected]" | ||
], | ||
"shell": { | ||
"init_hook": [ | ||
"cf install-plugin -f $(which app-autoscaler-cli-plugin)" | ||
], | ||
"scripts": { | ||
"test": [ | ||
"echo \"Error: no test specified\" && exit 1" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to test first, if the devbox-binary is available and only then do that eval. Similarly as it has been before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point: #2921