Compare commits

..

No commits in common. "main" and "0.0.2" have entirely different histories.
main ... 0.0.2

5 changed files with 16 additions and 20 deletions

View File

@ -9,12 +9,12 @@ jobs:
build: build:
runs-on: kcrawford/dind runs-on: kcrawford/dind
container: container:
image: kcrawford/dind:0.0.2 image: kcrawford/dind:0.0.1
steps: steps:
- name: Clone - name: Clone
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.LOCAL_SSH_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519 echo "${{ secrets.PI_GIT_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
ssh-keyscan git.kcrawford.net >> ~/.ssh/known_hosts ssh-keyscan git.kcrawford.net >> ~/.ssh/known_hosts
git clone --branch ${GITHUB_REF_NAME} git@git.kcrawford.net:${{env.GITHUB_REPOSITORY}}.git . git clone --branch ${GITHUB_REF_NAME} git@git.kcrawford.net:${{env.GITHUB_REPOSITORY}}.git .
@ -28,6 +28,5 @@ jobs:
- name: Build - name: Build
run: | run: |
#while true; do sleep 180; done
docker buildx create --use docker buildx create --use
docker buildx build --no-cache --platform linux/amd64,linux/arm64 --output type=registry -t git.kcrawford.net/kcrawford/$(basename $(pwd)):${GITHUB_REF##*/} . docker buildx build --no-cache --platform linux/amd64,linux/arm64 --output type=registry -t git.kcrawford.net/kcrawford/$(basename $(pwd)):${GITHUB_REF##*/} .

View File

@ -7,14 +7,14 @@ on:
jobs: jobs:
build: build:
runs-on: kcrawford/gobuilder runs-on: gobuilder
container: container:
image: kcrawford/gobuilder:0.0.5 image: gobuilder:0.0.5
steps: steps:
- name: Clone - name: Clone
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "${{ secrets.LOCAL_SSH_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519 echo "${{ secrets.PI_GIT_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
ssh-keyscan git.kcrawford.net >> ~/.ssh/known_hosts ssh-keyscan git.kcrawford.net >> ~/.ssh/known_hosts
git clone --branch ${GITHUB_REF_NAME} git@git.kcrawford.net:${{env.GITHUB_REPOSITORY}}.git . git clone --branch ${GITHUB_REF_NAME} git@git.kcrawford.net:${{env.GITHUB_REPOSITORY}}.git .

View File

@ -1,8 +1,10 @@
# Build stage # specify the base image to be used for the application
FROM golang:1.21.4-alpine AS builder FROM golang:1.21.4-alpine
# create the working directory in the image
WORKDIR /app WORKDIR /app
# copy Go modules and dependencies to image
COPY go.mod ./ COPY go.mod ./
# download Go modules and dependencies # download Go modules and dependencies
@ -11,14 +13,11 @@ RUN go mod download
# copy all the Go files ending with .go extension # copy all the Go files ending with .go extension
COPY *.go ./ COPY *.go ./
RUN go build -o golang-http-header # compile application
RUN go build -o /golang-http-header
# Final stage
FROM scratch
COPY --from=builder /app/golang-http-header /
# network port at runtime # network port at runtime
EXPOSE 8000 EXPOSE 8000
CMD ["/golang-http-header"] # execute when the container starts
CMD [ "/golang-http-header" ]

View File

@ -1,2 +1 @@
# Intro noop
Creates a Pod that listens on port 8000/tcp and responds to GET requests with the hostname of the machine running the Pod.

View File

@ -8,7 +8,6 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: http-header name: http-header
namespace: golang
labels: labels:
app: golang app: golang
spec: spec:
@ -23,7 +22,7 @@ spec:
spec: spec:
containers: containers:
- name: http-header - name: http-header
image: git.kcrawford.net/kcrawford/golang-http-header:0.0.3 image: git.kcrawford.net/kcrawford/golang-http-header:0.0.5
ports: ports:
- containerPort: 8000 - containerPort: 8000