Compare commits
9 Commits
7fc73921d3
...
build
| Author | SHA1 | Date | |
|---|---|---|---|
| 0187d4031c | |||
| e5aced29a3 | |||
| 8605f39f53 | |||
| aa601454fd | |||
| 90bf0bcb73 | |||
| 2c70f0660e | |||
| 9f85187b21 | |||
| 4df3116475 | |||
| 42bbe1fa21 |
@@ -1,5 +1,5 @@
|
||||
name: Fibonacci unit tests
|
||||
run-name: ${{ gitea.actor }} is testing Fibonacci
|
||||
name: Fibonacci container test
|
||||
run-name: ${{ gitea.actor }} is testing Fibonacci containerization
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
||||
@@ -18,5 +18,7 @@ jobs:
|
||||
check-latest: true
|
||||
- name: Test functions module
|
||||
run: go test ./functions -v
|
||||
working-directory: ./code
|
||||
- name: Test actual build
|
||||
run: go build
|
||||
working-directory: ./code
|
||||
|
||||
1
code/.gitignore
vendored
1
code/.gitignore
vendored
@@ -11,6 +11,7 @@
|
||||
# But not these files...
|
||||
!/.gitignore
|
||||
|
||||
!functions/*.go
|
||||
!*.go
|
||||
!go.sum
|
||||
!go.mod
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package functions
|
||||
|
||||
import(
|
||||
"errors"
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -11,7 +10,7 @@ func MyFibonacci(count int) (fibonaccivalue int, error error) {
|
||||
var prev_fibonacci int = 0
|
||||
|
||||
if count < 1 {
|
||||
return -1, errors.New(fmt.Sprintf("%d is not a positive integer.",count))
|
||||
return -1, fmt.Errorf("%d is not a positive integer", count)
|
||||
}
|
||||
for i := 1; i < count; i++ {
|
||||
fibonaccivalue += prev_fibonacci
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module darjeeling.systemec.nl/rhouben/fibonacci
|
||||
replace darjeeling.systemec.nl/rhouben/fibonacci/functions => ./functions
|
||||
|
||||
go 1.24.4
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"flag"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
|
||||
@@ -24,7 +24,7 @@ func main() {
|
||||
}
|
||||
port_arg := os.Getenv("FIB_PORT")
|
||||
if port_arg != "" {
|
||||
fmt.Printf("Loaded port value '%s' from environment.\n",port_arg)
|
||||
fmt.Printf("Loaded port value '%s' from environment.\n", port_arg)
|
||||
port_number, error = strconv.Atoi(port_arg)
|
||||
if error != nil {
|
||||
fmt.Printf("I had an error trying to parse '%s' into a number: %s\n",
|
||||
@@ -33,9 +33,9 @@ func main() {
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
flag.IntVar(&port, "port", 8098,
|
||||
flag.IntVar(&port, "port", 8098,
|
||||
fmt.Sprintf("Port number to bind to, default %d", port_number))
|
||||
flag.IntVar(&seq, "number", 0,
|
||||
flag.IntVar(&seq, "number", 0,
|
||||
"Fibonacci sequence value to calculate")
|
||||
flag.Parse()
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
FROM golang:1.23-bookworm AS base
|
||||
FROM golang:1.24-bookworm AS base
|
||||
|
||||
# /build is the working directory
|
||||
WORKDIR /build
|
||||
|
||||
# Copy control files and pull in dependencies
|
||||
COPY go.mod .
|
||||
RUN go mod download
|
||||
COPY code/ ./
|
||||
RUN go mod tidy \
|
||||
&& go mod download
|
||||
|
||||
ENV port=8089
|
||||
# Copy the rest of the source code into the container
|
||||
COPY code/* .
|
||||
|
||||
# Build the app
|
||||
|
||||
|
||||
39
openpgp-policy.toml
Normal file
39
openpgp-policy.toml
Normal file
@@ -0,0 +1,39 @@
|
||||
version = 0
|
||||
commit_goodlist = []
|
||||
|
||||
[authorization."Rens Houben <lpmhouben@gmail.com>"]
|
||||
sign_commit = true
|
||||
sign_tag = true
|
||||
sign_archive = true
|
||||
add_user = true
|
||||
retire_user = true
|
||||
audit = true
|
||||
keyring = """
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Comment: E440 6FB1 B3DE 72FC BB5A 31B6 B9BD 7068 7972 7348 DF96 C300 16E9 1615 C1CA 3244
|
||||
Comment: <lpmhouben@gmail.com>
|
||||
Comment: Rens Houben
|
||||
|
||||
xioGaJm15RsAAAAgaN/rppCWy2CMp+ptpgSv+PdNrRto2adth6QmlOwgZoPCrAYf
|
||||
GwoAAAA9BYJombXlBYkFpI+9AwsJBwMVCggCmwECHgkiIQbkQG+xs95y/LtaMba5
|
||||
vXBoeXJzSN+WwwAW6RYVwcoyRAAAAABf0iCRI80vGSLlZ05nqtSy1X9tkRrt9ZXH
|
||||
F5RZlDdGUF00mfPBZnIYcHyNu7KQpfz5XS8O7vC27fDjx0EgY6s9b0Y5GPmTZEpk
|
||||
jIs2ijl5teaaiwPPh6ow5Kg57v92EOFEUAfNFTxscG1ob3ViZW5AZ21haWwuY29t
|
||||
PsKsBhMbCgAAAD0FgmiZteUFiQWkj70DCwkHAxUKCAKbAQIeCSIhBuRAb7Gz3nL8
|
||||
u1oxtrm9cGh5cnNI35bDABbpFhXByjJEAAAAAJHaIFARgIT42hWyM6UPxr42sPKd
|
||||
jlPALYaYHOYuVtDbb/CHA4LBgfwmSGdRimrf9Sq3+rAmb5JSLipYcd3mnrWBIjqc
|
||||
wpdz0ClJC01ZzT9Rw4pnOoZueH90ApxVjOjPd0PBAc0LUmVucyBIb3ViZW7CrwYT
|
||||
GwoAAABABYJombXlBYkFpI+9AwsJBwMVCggCmQECmwECHgkiIQbkQG+xs95y/Lta
|
||||
Mba5vXBoeXJzSN+WwwAW6RYVwcoyRAAAAABhmSDBodFpCvgrvmxI5gPOArSU3BDX
|
||||
4WXqK8uN08ppnKjno6jWPwVMh4mtQZZhVIuZnNvIpnb4fZIa3npwBVFGw/fK6phj
|
||||
0TS9vSh2U9WKL1CE21dsSl16FqpA1qiJ7EyArQrOKgZombXlGwAAACAh7EFlctzR
|
||||
Hn/V4RlbrHBt0nJcPjZPE8kg45MBPLu408LAewYYGwoAAADMBYJombXlBYkFpI+9
|
||||
ApsCmaAGGRsKAAAAKQWCaJm15SIhBtz66d8XPr0tPfjKlTJSSk/BlB82V2PMYb4x
|
||||
rFo3auRxAAAAAOQxIII9+VkI23cNclHhcwYDjNm7VdQpyfQMpX4dFTsHr60ERqHz
|
||||
LGvExM6iFiB85hy7D82H7HPOI9LDbfMdjlhfZQbC1ZmzBVqyJE2DwQQqdm4JDlGJ
|
||||
T8M4wf9JN7JJ0VRKAiIhBuRAb7Gz3nL8u1oxtrm9cGh5cnNI35bDABbpFhXByjJE
|
||||
AAAAAMqZIGLwh64mdeHOsLRPaB3UvyXonaaSnr2XqunoiOdPVT1u4Kgg7MaKggxk
|
||||
RPis16dnrwiKgBh7AMT4l22ZDlGE5FJcYu0PT5YAsLQrdJAw4+HCdga0sd2vefUT
|
||||
SsuNjA9rDw==
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
"""
|
||||
Reference in New Issue
Block a user