Skip to content

Commit

Permalink
feat: Add uv and remove docker dependency (#447)
Browse files Browse the repository at this point in the history
Related to: #442
  • Loading branch information
rehan892 authored Jan 3, 2025
1 parent 7af32cb commit a0a62b1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 142 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/setup-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,8 @@ name: Create scaf project
on: [push]

jobs:
build-and-push:
environment: dev
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
# not needed? https://github.com/docker/build-push-action/tree/releases/v5?tab=readme-ov-file#git-context

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Build and push Docker image using github's buildkit cache
uses: docker/build-push-action@v5
with:
push: true
tags: |
sixfeetup/scaf:${{ github.sha }}
sixfeetup/scaf:latest
context: .
file: ./Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

setup:
environment: dev
needs: build-and-push
runs-on: ubuntu-latest

steps:
Expand Down
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

83 changes: 0 additions & 83 deletions entrypoint.sh

This file was deleted.

14 changes: 13 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ install_tilt() {
tilt version
}

install_uv() {
echo "Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
if command_exists uv; then
echo "🎉 uv installed successfully 🎉"
uv --version
else
echo "🧨 Failed to install uv. 🧨"
exit 1
fi
}

install_scaf() {
# Install/re-install scaf
if [ -f "$TEMP_DOWNLOAD" ]; then
Expand Down Expand Up @@ -318,7 +330,7 @@ check_top_level_dependencies
[ -n "$DEBUG" ] && echo "Checking Git Config"
check_git_config

for tool in kubectl kind tilt; do
for tool in kubectl kind tilt uv; do
if ! command_exists $tool; then
echo "$tool is not installed."
install_$tool
Expand Down
15 changes: 2 additions & 13 deletions scaf
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,8 @@ if [[ "$SCAF_CHALLENGE" == "y" ]]; then
CHALLENGE_CONFIG=$(cat $CHALLENGE_CONFIG_PATH)
fi

IMAGE_TAG=${IMAGE_TAG:-latest}
docker run --rm $DOCKER_RUN_OPTIONS -v "$(pwd):/home/scaf/out" \
-e HOST_UID="$(id -u)" \
-e HOST_GID="$(id -g)" \
-e CHALLENGE_CONFIG="$CHALLENGE_CONFIG" \
docker.io/sixfeetup/scaf:$IMAGE_TAG \
cookiecutter \
$COOKIECUTTER_OPTIONS \
$REPO_URL \
--directory="$DEFAULT_DIRECTORY" \
project_slug="$COOKIECUTTER_SLUG" \
_challenge="$SCAF_CHALLENGE"

echo "Creating your project..."
uv run --with isort,black,cookiecutter cookiecutter $COOKIECUTTER_OPTIONS $REPO_URL --directory="$DEFAULT_DIRECTORY" project_slug="$COOKIECUTTER_SLUG" _challenge="$SCAF_CHALLENGE"

# Check if cookiecutter was successful
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit a0a62b1

Please sign in to comment.