-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deps): Add
devbox
config (#2914)
# Issue Specifying exact versions for dependencies in Nix is not straightforward. # Fix This commit adds a basic `devbox` configuration for our project. If you want to try it out: [Install devbox] and run `devbox shell` [Install devbox]: https://www.jetpack.io/devbox/docs/installing_devbox/ * fix(deps): Rollback `concourse` version # Issue The required version of the concourse CLI is dictated by the server. concourse.app-runtime-interfaces.ci.cloudfoundry.org is on 7.10.0 # Fix Rollback and disable automated updates through renovate * 🤖🦾🛠️ scripts/asdf2devbox.py
- Loading branch information
Showing
11 changed files
with
1,464 additions
and
16 deletions.
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: | | ||
#! /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: | | ||
#! /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.