From ef0d830dc65bdb7d0e83d54ca8945cd14e98d313 Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Sun, 12 Oct 2025 23:35:33 -0500 Subject: [PATCH] update install scripts --- pkg/appview/static/install.ps1 | 25 +++++++++---------------- pkg/appview/static/install.sh | 26 ++++++++------------------ scripts/publish-artifact.sh | 4 +++- 3 files changed, 20 insertions(+), 35 deletions(-) diff --git a/pkg/appview/static/install.ps1 b/pkg/appview/static/install.ps1 index 11540f4..f854cf2 100644 --- a/pkg/appview/static/install.ps1 +++ b/pkg/appview/static/install.ps1 @@ -4,9 +4,11 @@ $ErrorActionPreference = "Stop" # Configuration -$Repo = "atcr-io/atcr" $BinaryName = "docker-credential-atcr.exe" $InstallDir = if ($env:ATCR_INSTALL_DIR) { $env:ATCR_INSTALL_DIR } else { "$env:ProgramFiles\ATCR" } +$Version = "v0.0.1" +$TagHash = "c6cfbaf1723123907f9d23e300f6f72081e65006" +$TangledRepo = "https://tangled.org/@evan.jarrett.net/at-container-registry" Write-Host "ATCR Credential Helper Installer for Windows" -ForegroundColor Green Write-Host "" @@ -27,23 +29,14 @@ function Get-Architecture { $Arch = Get-Architecture Write-Host "Detected: Windows $Arch" -ForegroundColor Green -# Get latest release version -function Get-LatestVersion { - Write-Host "Fetching latest version..." -ForegroundColor Yellow - $releaseUrl = "https://api.github.com/repos/$Repo/releases/latest" - try { - $release = Invoke-RestMethod -Uri $releaseUrl -UseBasicParsing - return $release.tag_name - } catch { - Write-Host "Failed to fetch latest version: $_" -ForegroundColor Red - exit 1 - } +if ($env:ATCR_VERSION) { + $Version = $env:ATCR_VERSION + Write-Host "Using specified version: $Version" -ForegroundColor Yellow +} else { + Write-Host "Using version: $Version" -ForegroundColor Green } -$Version = if ($env:ATCR_VERSION) { $env:ATCR_VERSION } else { Get-LatestVersion } -Write-Host "Latest version: $Version" -ForegroundColor Green - # Download and install binary function Install-Binary { param ( @@ -53,7 +46,7 @@ function Install-Binary { $versionClean = $Version.TrimStart('v') $fileName = "docker-credential-atcr_${versionClean}_Windows_${Arch}.zip" - $downloadUrl = "https://github.com/$Repo/releases/download/$Version/$fileName" + $downloadUrl = "$TangledRepo/tags/$TagHash/download/$fileName" Write-Host "Downloading from: $downloadUrl" -ForegroundColor Yellow diff --git a/pkg/appview/static/install.sh b/pkg/appview/static/install.sh index 9bae254..f41607c 100755 --- a/pkg/appview/static/install.sh +++ b/pkg/appview/static/install.sh @@ -11,9 +11,11 @@ YELLOW='\033[1;33m' NC='\033[0m' # No Color # Configuration -REPO="atcr-io/atcr" BINARY_NAME="docker-credential-atcr" INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" +VERSION="v0.0.1" +TAG_HASH="c6cfbaf1723123907f9d23e300f6f72081e65006" +TANGLED_REPO="https://tangled.org/@evan.jarrett.net/at-container-registry" # Detect OS and architecture detect_platform() { @@ -47,23 +49,11 @@ detect_platform() { esac } -# Get latest release version -get_latest_version() { - echo -e "${YELLOW}Fetching latest version...${NC}" - LATEST_VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - - if [ -z "$LATEST_VERSION" ]; then - echo -e "${RED}Failed to fetch latest version${NC}" - exit 1 - fi - - echo -e "${GREEN}Latest version: ${LATEST_VERSION}${NC}" -} # Download and install binary install_binary() { - local version="${1:-$LATEST_VERSION}" - local download_url="https://github.com/${REPO}/releases/download/${version}/docker-credential-atcr_${version#v}_${OS}_${ARCH}.tar.gz" + local version="${1:-$VERSION}" + local download_url="${TANGLED_REPO}/tags/${TAG_HASH}/download/docker-credential-atcr_${version#v}_${OS}_${ARCH}.tar.gz" echo -e "${YELLOW}Downloading from: ${download_url}${NC}" @@ -135,10 +125,10 @@ main() { # Allow specifying version via environment variable if [ -z "$ATCR_VERSION" ]; then - get_latest_version + echo -e "Using version: ${GREEN}${VERSION}${NC}" else - LATEST_VERSION="$ATCR_VERSION" - echo -e "Using specified version: ${GREEN}${LATEST_VERSION}${NC}" + VERSION="$ATCR_VERSION" + echo -e "Using specified version: ${GREEN}${VERSION}${NC}" fi install_binary diff --git a/scripts/publish-artifact.sh b/scripts/publish-artifact.sh index cc042b7..084fa74 100755 --- a/scripts/publish-artifact.sh +++ b/scripts/publish-artifact.sh @@ -15,4 +15,6 @@ ARTIFACT_JSON=$(echo "$BLOB_OUTPUT" | jq --arg tag "$TAG_BYTES" --arg name "$ART }') && echo "$ARTIFACT_JSON" > temp_artifact.json && cat temp_artifact.json && -goat record create temp_artifact.json -n \ No newline at end of file +goat record create temp_artifact.json -n +rm temp_artifact.json +sleep 2 \ No newline at end of file