Compare commits

...

8 Commits

Author SHA1 Message Date
90bf0bcb73 Still not working
Some checks failed
Fibonacci unit tests / Containerize (push) Failing after 10s
Fibonacci unit tests / Run-unit-tests (push) Successful in 16s
2025-08-11 14:59:03 +02:00
2c70f0660e Updated go sums
Some checks failed
Fibonacci unit tests / Containerize (push) Failing after 5s
Fibonacci unit tests / Run-unit-tests (push) Successful in 16s
2025-08-11 09:56:52 +02:00
9f85187b21 Fix unit test workflow to work with new structure
Some checks failed
Fibonacci unit tests / Containerize (push) Failing after 6s
Fibonacci unit tests / Run-unit-tests (push) Failing after 18s
2025-08-11 09:04:50 +02:00
4df3116475 Merge branch 'build' of darjeeling:rhouben/fibonacci into build
Some checks failed
Fibonacci unit tests / Run-unit-tests (push) Failing after 24s
Fibonacci unit tests / Containerize (push) Failing after 31s
2025-08-11 09:01:43 +02:00
42bbe1fa21 Minor additions 2025-08-11 09:01:34 +02:00
7fc73921d3 First attempt at creating dockerfile
Some checks failed
Fibonacci unit tests / Containerize (push) Failing after 27s
Fibonacci unit tests / Run-unit-tests (push) Failing after 4s
2025-08-08 16:21:04 +02:00
e8d042b65e Moving go code to subdir. 2025-08-08 15:17:12 +02:00
853bee22db Mark the container workflow as in progress andfail it.
Some checks failed
Fibonacci unit tests / Containerize (push) Failing after 5s
Fibonacci unit tests / Run-unit-tests (push) Successful in 38s
2025-07-24 13:40:38 +02:00
13 changed files with 46 additions and 30 deletions

View File

@@ -18,5 +18,6 @@ jobs:
go-version: '1.24.4'
check-latest: true
- name: Containerize app
run: exit 0
run: |
echo "Still needs to be implemented."
exit 1

View File

@@ -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

25
.gitignore vendored
View File

@@ -1,26 +1,3 @@
# Allowlisting gitignore template for GO projects prevents us
# from adding various unwanted local files, such as generated
# files, developer configurations or IDE-specific files etc.
#
# Recommended: Go.AllowList.gitignore
# Ignore everything
*
.env
# But not these files...
!/.gitignore
!*.go
!go.sum
!go.mod
!README.md
!LICENSE
# !Makefile
# ...even if they are in subdirectories
!*/
!.gitea/*
!.gitea/workflows/*
.swp

16
code/.gitignore vendored Normal file
View File

@@ -0,0 +1,16 @@
# Allowlisting gitignore template for GO projects prevents us
# from adding various unwanted local files, such as generated
# files, developer configurations or IDE-specific files etc.
#
# Recommended: Go.AllowList.gitignore
# Ignore everything
*
.env
# But not these files...
!/.gitignore
!*.go
!go.sum
!go.mod

View File

View File

View File

@@ -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()

20
docker/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM golang:1.23-bookworm AS base
# /build is the working directory
WORKDIR /build
# Copy control files and pull in dependencies
COPY code/go.mod .
RUN go mod download
ENV port=8089
# Copy the rest of the source code into the container
COPY code/* .
# Build the app
RUN go build -o fibonacci
EXPOSE ${port}
CMD ["build/fibonacci"]