Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
.github
README.md
LICENSE
*.md
.vscode
.gitignore
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
# Monitor Docker base image
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "chore"
include: "scope"
ignore:
# Block major version updates for Alpine (e.g., 3.18 -> 3.19)
# Allow only patch and minor updates within the same major version
- dependency-name: "alpine"
update-types: ["version-update:semver-major"]

# Monitor GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
commit-message:
prefix: "chore"
include: "scope"
26 changes: 26 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Auto-merge Dependabot PRs

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
check_suite:
types: [completed]

permissions:
contents: write
pull-requests: write
checks: read

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
target: main
merge-method: squash
use-github-auto-merge: true
skip-verification: false
65 changes: 65 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Release

on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: ""
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: slinktool-image:test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test Docker image
run: |
docker run --rm slinktool-image:test -V || docker run --rm slinktool-image:test -h || true
11 changes: 11 additions & 0 deletions .github/workflows/commitmsg-conform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Commit Message Conformance
on:
pull_request: {}
permissions:
statuses: write
checks: write
contents: read
pull-requests: read
jobs:
commitmsg-conform:
uses: actionsforge/actions/.github/workflows/commitmsg-conform.yml@main
14 changes: 14 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Markdown Lint

on:
pull_request: {}

permissions:
statuses: write
checks: write
contents: read
pull-requests: read

jobs:
markdown-lint:
uses: actionsforge/actions/.github/workflows/markdown-lint.yml@main
20 changes: 20 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"recommendations": [
"amazonwebservices.aws-toolkit-vscode",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"Gruntfuggly.todo-tree",
"hashicorp.terraform",
"mhutchie.git-graph",
"ms-vscode-remote.remote-ssh-edit",
"ms-vscode-remote.remote-ssh",
"ms-vscode.remote-containers",
"ms-vscode.vscode-json",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"usernamehw.errorlens",
"vscode-icons-team.vscode-icons"
]
}
93 changes: 93 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"files.associations": {
"*.tf": "terraform",
"*.tfvars": "terraform",
"*.tfstate": "json",
"*.tfstate.backup": "json",
"*.hcl": "terraform",
"*.nomad": "hcl",
"*.consul": "hcl",
"*.vault": "hcl",
"*.dockerfile": "dockerfile",
"*.sh.tpl": "shellscript",
"docker-compose*.yml": "yaml",
"Dockerfile*": "dockerfile"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.terraform": true,
"**/.terraform.lock.hcl": true,
"**/terraform.tfstate*": true,
"**/.terraform.tfstate.lock.info": true,
"__debug_bin": true,
"vendor/": true,
"go.sum": true
},
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"files.autoSave": "onFocusChange",
"search.exclude": {
"**/.terraform": true,
"**/terraform.tfstate*": true,
"**/.terraform.tfstate.lock.info": true
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.rulers": [80, 120],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "Default Dark+",
"terraform.codelens.referenceCount": true,
"[terraform]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "hashicorp.terraform",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.rulers": [80, 120],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120
},
"[hcl]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "hashicorp.terraform",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[yaml]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[markdown]": {
"editor.defaultFormatter": "davidanson.vscode-markdownlint",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.wordWrap": "on"
}
}
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Multi-stage build for slinktool
# Stage 1: Build slinktool
FROM alpine:latest AS builder

# Install build dependencies
RUN apk add --no-cache \
build-base \
git \
make \
gcc \
musl-dev

# Clone and build slinktool
WORKDIR /build
RUN git clone https://github.com/EarthScope/slinktool.git . && \
make

# Install slinktool binary to /usr/local/bin
# The binary should be in the current directory after make
RUN if [ -f ./slinktool ]; then \
install -m 755 ./slinktool /usr/local/bin/slinktool; \
else \
find . -name "slinktool" -type f -executable -exec install -m 755 {} /usr/local/bin/slinktool \; && \
test -f /usr/local/bin/slinktool || (echo "ERROR: slinktool binary not found after build" && find . -type f && exit 1); \
fi

# Stage 2: Runtime image
FROM alpine:latest

# Install runtime dependencies (minimal - just what's needed to run)
# Note: If slinktool is statically linked, these may not be needed
# but ca-certificates is useful for HTTPS connections
RUN apk add --no-cache \
ca-certificates

# Copy the slinktool binary from builder
COPY --from=builder /usr/local/bin/slinktool /usr/local/bin/slinktool

# Verify the binary exists and is executable
RUN test -f /usr/local/bin/slinktool && /usr/local/bin/slinktool -V || true

# Set slinktool as the entrypoint
ENTRYPOINT ["slinktool"]

# Default command (can be overridden)
# slinktool requires arguments, so we'll just set the entrypoint
# Users should provide their own command arguments
Loading
Loading