Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2224 from replicatedhq/codespaces-sandbox
optimize build
- Loading branch information
Showing
8 changed files
with
79 additions
and
43 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
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,10 @@ | ||
apiVersion: k3d.io/v1alpha2 | ||
apiVersion: k3d.io/v1alpha3 | ||
kind: Simple | ||
name: replicated | ||
servers: 1 | ||
image: rancher/k3s:v1.21.4-k3s1 # v1.21.3-k3s1 default is broken | ||
registries: | ||
create: true | ||
create: | ||
name: k3d-replicated-registry.localhost | ||
host: "0.0.0.0" | ||
hostPort: "5000" |
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 @@ | ||
VERSION='dev' |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# install Krew | ||
# TODO (dans): ditch krew and just download the latest binaries on the path in Dockerfile | ||
( | ||
set -x; cd "$(mktemp -d)" && | ||
OS="$(uname | tr '[:upper:]' '[:lower:]')" && | ||
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && | ||
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" && | ||
tar zxvf krew.tar.gz && | ||
KREW=./krew-"${OS}_${ARCH}" && | ||
"$KREW" install krew | ||
) | ||
|
||
# install krew plugins | ||
kubectl krew install schemahero | ||
kubectl krew install support-bundle | ||
kubectl krew install preflights | ||
kubectl krew install view-secret | ||
|
||
# Make the cache from master branch | ||
pushd /tmp | ||
git clone https://github.com/replicatedhq/kots.git | ||
pushd kots | ||
# TODO (dans): find a way to cache images on image build | ||
go mod download | ||
popd | ||
rm -rf kots | ||
popd | ||
|
||
# Clone any extra repos here | ||
|
||
# Autocomplete Kubernetes | ||
cat >> ~/.zshrc << EOF | ||
source <(kubectl completion zsh) | ||
alias k=kubectl | ||
complete -F __start_kubectl k | ||
EOF | ||
|
||
# Set Git Editor Preference | ||
cat >> ~/.zshrc << EOF | ||
export VISUAL=vim | ||
export EDITOR="$VISUAL" | ||
EOF |
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,52 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Setup Skaffold | ||
cp /etc/replicated/skaffold.config $HOME/.skaffold/config | ||
|
||
# Setup the cluster | ||
k3d cluster create --config /etc/replicated/k3d-cluster.yaml --kubeconfig-update-default | ||
|
||
# install Krew | ||
# TODO (dans): ditch krew and just download the latest binaries on the path in Dockerfile | ||
( | ||
set -x; cd "$(mktemp -d)" && | ||
OS="$(uname | tr '[:upper:]' '[:lower:]')" && | ||
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && | ||
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" && | ||
tar zxvf krew.tar.gz && | ||
KREW=./krew-"${OS}_${ARCH}" && | ||
"$KREW" install krew | ||
) | ||
|
||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" | ||
|
||
# install krew plugins | ||
kubectl krew install schemahero | ||
kubectl krew install support-bundle | ||
kubectl krew install preflights | ||
kubectl krew install view-secret | ||
|
||
# install schemahero in the cluster | ||
kubectl schemahero install | ||
|
||
k3d cluster stop replicated | ||
|
||
# Make the cache | ||
make cache | ||
skaffold build | ||
|
||
# Clone any extra repos here | ||
|
||
# Autocomplete Kubernetes | ||
cat >> ~/.zshrc << EOF | ||
source <(kubectl completion zsh) | ||
alias k=kubectl | ||
complete -F __start_kubectl k | ||
EOF | ||
|
||
# Set Git Editor Preference | ||
cat >> ~/.zshrc << EOF | ||
|
||
export VISUAL=vim | ||
export EDITOR="$VISUAL" | ||
EOF |
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