Skip to content

Commit

Permalink
Publish a container to a minikube registry, instead of GitHub registry.
Browse files Browse the repository at this point in the history
This solves the permissions issues when running integratino tests
from non-ServiceWeaver org repositories (i.e., by external users).
  • Loading branch information
spetrovic77 committed Aug 24, 2023
1 parent 4b40f58 commit b993a71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
29 changes: 17 additions & 12 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: $(echo "192.168.50.2:5000/echo" | tr '[:upper:]' '[:lower:]')
WAIT_TIMEOUT: "5m"

on:
Expand All @@ -31,7 +31,7 @@ jobs:
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
Expand All @@ -43,20 +43,25 @@ jobs:

- 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: Setup the docker daemon and command.
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."192.168.50.2:5000"]
http = true
insecure = true
- 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

0 comments on commit b993a71

Please sign in to comment.