0.1.3 fb536a2

buildpush-dev.sh RawHistoryFolder

1#!/bin/bash
2set -e
3ENGINE="podman"
4REPO="ghcr.io/bnema/gordon"
5TAG="dev"
6DIST_DIR="./dist"
7
8# Function to handle errors
9handle_error() {
10    echo "Error occurred. Cleaning up..."
11    $ENGINE system prune -f
12    exit 1
13}
14
15# Set up error handling
16trap 'handle_error' ERR
17
18# Ensure dist directory exists
19mkdir -p $DIST_DIR
20
21# Build Go binaries for multiple platforms with CGO_ENABLED=0
22echo "Building Go binaries..."
23CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $DIST_DIR/gordon-linux-amd64 ./cmd/cli
24CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $DIST_DIR/gordon-linux-arm64 ./cmd/cli
25
26# Clean up any dangling images before building
27echo "Cleaning up dangling images..."
28$ENGINE image prune -f
29
30# Build Docker images for each architecture
31echo "Building Docker images..."
32$ENGINE build -t $REPO:${TAG}-amd64 --build-arg ARCH=amd64 -f Dockerfile .
33$ENGINE build -t $REPO:${TAG}-arm64v8 --build-arg ARCH=arm64 -f Dockerfile .
34
35# Push images
36echo "Pushing Docker images..."
37$ENGINE push $REPO:${TAG}-amd64
38$ENGINE push $REPO:${TAG}-arm64v8
39
40# Remove existing manifest if it exists
41echo "Removing existing manifest..."
42$ENGINE manifest rm $REPO:$TAG || true
43
44# Create multi-arch manifest
45echo "Creating multi-arch manifest..."
46$ENGINE manifest create $REPO:$TAG \
47  $REPO:${TAG}-amd64 \
48  $REPO:${TAG}-arm64
49
50# Annotate the arm64 image with variant information
51echo "Annotating arm64 image..."
52$ENGINE manifest annotate $REPO:$TAG \
53  $REPO:${TAG}-arm64 --arch arm64 --variant v8
54
55# Debug: List manifests
56echo "Listing manifests..."
57$ENGINE manifest inspect $REPO:$TAG
58
59# Push multi-arch manifest
60echo "Pushing multi-arch manifest..."
61$ENGINE manifest push --all $REPO:$TAG
62
63echo "Script completed successfully."

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close