Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
8eeea51f71 | |||
dc897a5464 | |||
5c91325772 | |||
c7250311cf | |||
6a21114ffb | |||
f34b6512ad | |||
cfa483a011 | |||
f9f1dd6264 | |||
98d38b94b2 | |||
cacddb9037 | |||
d5c73e8df6 | |||
3bbfbdcc92 | |||
56d18e9dae | |||
410e8b09f6 | |||
730813261b | |||
278a75a22d | |||
2af34ce476 | |||
674a793d80 | |||
bc86948544 | |||
68ca54bcc2 | |||
65dbff9ce4 | |||
c06d7be7f0 | |||
28064654ad | |||
4aa46a1cc3 | |||
ceb759b262 | |||
ab391618e0 | |||
a4a175ae0c |
33
.gitea/workflows/build-package.yaml
Normal file
33
.gitea/workflows/build-package.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: package-builder
|
||||||
|
run-name: package-builder
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release/*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: kcrawford/dind
|
||||||
|
container:
|
||||||
|
image: kcrawford/dind:0.0.2
|
||||||
|
steps:
|
||||||
|
- name: Clone
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.LOCAL_SSH_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
ssh-keyscan git.kcrawford.net >> ~/.ssh/known_hosts
|
||||||
|
git clone --branch ${GITHUB_REF_NAME} git@git.kcrawford.net:${{env.GITHUB_REPOSITORY}}.git .
|
||||||
|
|
||||||
|
- name: Inspect
|
||||||
|
run: |
|
||||||
|
env
|
||||||
|
mkdir ~/.docker
|
||||||
|
echo "${{ secrets.DOCKER_LOGIN }}" | base64 -d > ~/.docker/config.json
|
||||||
|
docker info
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
#while true; do sleep 180; done
|
||||||
|
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##*/} .
|
@ -7,14 +7,14 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gobuilder
|
runs-on: kcrawford/gobuilder
|
||||||
container:
|
container:
|
||||||
image: gobuilder:0.0.5
|
image: kcrawford/gobuilder:0.0.5
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.PI_GIT_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519
|
echo "${{ secrets.LOCAL_SSH_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 .
|
17
Dockerfile
17
Dockerfile
@ -1,10 +1,8 @@
|
|||||||
# specify the base image to be used for the application
|
# Build stage
|
||||||
FROM golang:1.21.4-alpine
|
FROM golang:1.21.4-alpine AS builder
|
||||||
|
|
||||||
# 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
|
||||||
@ -13,11 +11,14 @@ 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 ./
|
||||||
|
|
||||||
# compile application
|
RUN go build -o golang-http-header
|
||||||
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
|
||||||
|
|
||||||
# execute when the container starts
|
CMD ["/golang-http-header"]
|
||||||
CMD [ "/golang-http-header" ]
|
|
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Intro
|
||||||
|
Creates a Pod that listens on port 8000/tcp and responds to GET requests with the hostname of the machine running the Pod.
|
@ -1,7 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: golang
|
||||||
|
|
||||||
|
---
|
||||||
apiVersion: apps/v1
|
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:
|
||||||
@ -16,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: http-header
|
- name: http-header
|
||||||
image: git.kcrawford.net/kcrawford/golang-http-header:0.0.4
|
image: git.kcrawford.net/kcrawford/golang-http-header:0.0.3
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user