Skip to content

Commit 12aba2f

Browse files
committed
add github action
1 parent 59bd8d6 commit 12aba2f

3 files changed

Lines changed: 39 additions & 5 deletions

File tree

.github/build_and_push.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Push Training Application
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
# - name: Lint application
17+
# run: make lint
18+
- name: Build application
19+
run: make build
20+
# - name: Lint Dockerfiles
21+
# run: make docker-lint
22+
23+
# TODO remove this after quay creds are set
24+
- name: Build all Docker Images
25+
run: make docker-build-all
26+
27+
# - name: Login to Quay
28+
# uses: docker/login-action@v3
29+
# with:
30+
# registry: quay.io
31+
# username: ${{ secrets.QUAY_USERNAME }}
32+
# password: ${{ secrets.QUAY_ROBOT_TOKEN }}
33+
34+
# - name: Push all Docker Images
35+
# run: make docker-push-all

src/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ func handleSigterm(signalChanel chan os.Signal, exitChanel chan int) {
9191
}
9292
log.Info("Graceful Shutdown has finished")
9393
exitChanel <- 0
94-
} else if signal == syscall.SIGKILL {
95-
log.Info("Got SIGKILL signal")
9694
} else {
9795
log.Errorf("Got unknown signal '%s'", signal)
9896
exitChanel <- 1

src/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ func (s *server) handleRoot(w http.ResponseWriter, r *http.Request) {
5656
fmt.Fprintf(w, "Application Liveness: %t<br>", s.config.alive)
5757
fmt.Fprintf(w, "Application Readiness: %t<br>", s.config.ready)
5858
fmt.Fprintf(w, "Delay seconds of root endpoint ('/'): %d<br>", s.config.rootDelaySeconds)
59-
fmt.Fprintf(w, "Seconds needed for startup: %d<br>", s.config.startUpDelaySeconds)
60-
fmt.Fprintf(w, "Seconds needed for teardown: %d<br>", s.config.tearDownDelaySeconds)
59+
fmt.Fprintf(w, "Seconds the application needs to start up: %d<br>", s.config.startUpDelaySeconds)
60+
fmt.Fprintf(w, "Seconds the application needs to shut down gracefuly: %d<br>", s.config.tearDownDelaySeconds)
6161
fmt.Fprintf(w, "Only log to file: %v<br>", s.config.logToFileOnly)
6262

6363
fmt.Fprint(w, "<h2>Tech Details</h2>")
6464
fmt.Fprintf(w, "Process Id of the application: %d<br>", os.Getpid())
65-
fmt.Fprintf(w, "User Id of the application: %d<br>", os.Getuid())
65+
fmt.Fprintf(w, "User Id the application is using: %d<br>", os.Getuid())
6666
hostName, _ := os.Hostname()
6767
fmt.Fprintf(w, "Hostname: %s<br>", hostName)
6868

6969
if s.config.catImageUrl != "" {
70+
fmt.Fprint(w, "<h2>The promised cute cat</h2>")
7071
fmt.Fprintf(w, "<img src='%s' width='500px'></img>", s.config.catImageUrl)
7172
}
7273

0 commit comments

Comments
 (0)