0.1.6 11bec3a

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..."
32for ARCH in amd64 arm64; do
33    # Copy the appropriate binary to the root directory and rename it to 'gordon'
34    cp $DIST_DIR/gordon-linux-$ARCH gordon
35
36    # Build the Docker image
37    $ENGINE build -t $REPO:${TAG}-$ARCH .
38
39    # Remove the temporary 'gordon' file
40    rm gordon
41done
42
43# Push images
44echo "Pushing Docker images..."
45$ENGINE push $REPO:${TAG}-amd64
46$ENGINE push $REPO:${TAG}-arm64
47
48# Remove existing manifest if it exists
49echo "Removing existing manifest..."
50$ENGINE manifest rm $REPO:$TAG || true
51
52# Create multi-arch manifest
53echo "Creating multi-arch manifest..."
54$ENGINE manifest create $REPO:$TAG \
55  $REPO:${TAG}-amd64 \
56  $REPO:${TAG}-arm64
57
58# Annotate the arm64 image with variant information
59echo "Annotating arm64 image..."
60$ENGINE manifest annotate $REPO:$TAG \
61  $REPO:${TAG}-arm64 --arch arm64 --variant v8
62
63# Debug: List manifests
64echo "Listing manifests..."
65$ENGINE manifest inspect $REPO:$TAG
66
67# Push multi-arch manifest
68echo "Pushing multi-arch manifest..."
69$ENGINE manifest push --all $REPO:$TAG
70
71echo "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