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

Publish a container to a minikube registry, instead of GitHub registry. #51

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name: Integration Test

env:
CONFIG_FILE: deploy.toml
IMAGE_NAME: $(echo "ghcr.io/${{ github.repository }}/echo" | tr '[:upper:]' '[:lower:]')
IMAGE_NAME: 192.168.50.2:5000/echo
WAIT_TIMEOUT: "5m"

on:
Expand All @@ -29,34 +29,39 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: "Re-configure docker"
# NOTE: This step allows the weaver-kube tool to push the container images
# to the minikube cluster repository.
run: |
echo '{"insecure-registries" : ["192.168.50.2:5000"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl daemon-reload
sudo systemctl restart docker

- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
cache: true

- name: Setup kubectl.
uses: azure/setup-kubectl@v3

- name: Setup minikube
uses: medyagh/setup-minikube@master

- name: Login into Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
start-args: '--subnet 192.168.50.0/24'
addons: registry
insecure-registry: '192.168.50.0/24'

- name: Install weaver-kube
run: cd cmd/weaver-kube; go build .

- name: Build echo example.
run: cd examples/echo; go build .

- name: Generate app config file
run: |
CONFIG=$(cat << EOF
Expand All @@ -72,7 +77,7 @@ jobs:

- name: Build the docker image and push
run: ./cmd/weaver-kube/weaver-kube deploy --runInDevMode ${{ env.CONFIG_FILE }}

- name: Deploy the application
run: kubectl apply -f ./kube_*.yaml

Expand All @@ -91,5 +96,5 @@ jobs:
kubectl get all
kubectl describe pod
kubectl logs -l appName=echo


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cmd/weaver-kube/weaver-kube
examples/echo/echo
2 changes: 1 addition & 1 deletion internal/impl/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// runtime errors (e.g., glibc).
var dockerfileTmpl = template.Must(template.New("Dockerfile").Parse(`
{{if . }}
FROM golang:1.20-bullseye as builder
FROM golang:bullseye as builder
RUN echo ""{{range .}} && go install {{.}}{{end}}
{{end}}
FROM ubuntu:rolling
Expand Down