Skip to content

Commit a98f6fe

Browse files
committed
Merge branch 'main' into edw-byoc-account-in-domain
2 parents 46e143c + 3710153 commit a98f6fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2361
-1018
lines changed

.github/workflows/install.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66
push:
77
branches:
8-
- main
8+
- "**"
99
paths:
1010
- '.github/workflows/install.yml'
1111
- 'src/bin/install'
@@ -15,8 +15,19 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- name: Install defang
18+
- name: Install defang (latest)
1919
run: . <(curl -Ls https://s.defang.io/install)
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # avoid rate limiting
22+
23+
- name: Sanity check
24+
run: defang --version
25+
26+
- name: Install defang (specific version)
27+
run: . <(curl -Ls https://s.defang.io/install)
28+
env:
29+
DEFANG_INSTALL_VERSION: v0.5.36
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # alt name
2031

2132
- name: Sanity check
2233
run: defang --version

pkgs/defang/cli.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildGoModule {
66
pname = "defang-cli";
77
version = "git";
88
src = ../../src;
9-
vendorHash = "sha256-ZV9m9uRrJyP7LjrrpsZz9LK+IJZ+1YQSLmtiin3FYl4=";
9+
vendorHash = "sha256-9T71kpXPQGxtlWiow5x4d7uoHdOFAhtKpOOP2+p/H8Q=";
1010

1111
subPackages = [ "cmd/cli" ];
1212

pkgs/defang/default.nix

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ system ? builtins.currentSystem
1010
}:
1111
let
1212
shaMap = {
13-
x86_64-linux = "0rdid5havv8yrvvgi70ic4ml88d2ml9l3glvs85d2i0zna0k3yaj";
14-
aarch64-linux = "1qakg5gdray9x8inrs3rf3iz04yw8y8wygzgh00qdn8bxlhi2x2g";
15-
x86_64-darwin = "1fs60w7lvmb1jc5m1nbih93mkygh1s1zv074razc5bjf4v6mz8il";
16-
aarch64-darwin = "1fs60w7lvmb1jc5m1nbih93mkygh1s1zv074razc5bjf4v6mz8il";
13+
x86_64-linux = "1wzrjlwx1iv1zydj77k2qya7z40s6cpf6jkj80vg0sv27vxl3ayq";
14+
aarch64-linux = "00sy50ivnfnp1lh1lip6f13vvz3c453i7849pq33570rjdkh9z6i";
15+
x86_64-darwin = "0dchv18cv07nafkdaxqc1xrjqm8knijvlz202vjkahyxng7v70pp";
16+
aarch64-darwin = "0dchv18cv07nafkdaxqc1xrjqm8knijvlz202vjkahyxng7v70pp";
1717
};
1818

1919
urlMap = {
20-
x86_64-linux = "https://github.com/DefangLabs/defang/releases/download/v0.5.40/defang_0.5.40_linux_amd64.tar.gz";
21-
aarch64-linux = "https://github.com/DefangLabs/defang/releases/download/v0.5.40/defang_0.5.40_linux_arm64.tar.gz";
22-
x86_64-darwin = "https://github.com/DefangLabs/defang/releases/download/v0.5.40/defang_0.5.40_macOS.zip";
23-
aarch64-darwin = "https://github.com/DefangLabs/defang/releases/download/v0.5.40/defang_0.5.40_macOS.zip";
20+
x86_64-linux = "https://github.com/DefangLabs/defang/releases/download/v0.5.44/defang_0.5.44_linux_amd64.tar.gz";
21+
aarch64-linux = "https://github.com/DefangLabs/defang/releases/download/v0.5.44/defang_0.5.44_linux_arm64.tar.gz";
22+
x86_64-darwin = "https://github.com/DefangLabs/defang/releases/download/v0.5.44/defang_0.5.44_macOS.zip";
23+
aarch64-darwin = "https://github.com/DefangLabs/defang/releases/download/v0.5.44/defang_0.5.44_macOS.zip";
2424
};
2525
in
2626
stdenvNoCC.mkDerivation {
2727
pname = "defang";
28-
version = "0.5.40";
28+
version = "0.5.44";
2929
src = fetchurl {
3030
url = urlMap.${system};
3131
sha256 = shaMap.${system};

pkgs/npm/package-lock.json

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/npm/src/clilib.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ async function getLatestVersion(): Promise<string> {
2828
}
2929

3030
async function downloadAppArchive(
31-
version: string,
3231
archiveFilename: string,
3332
outputPath: string
3433
): Promise<string | null> {
35-
const repo = "DefangLabs/defang";
36-
const downloadUrl = `https://github.com/${repo}/releases/download/v${version}/${archiveFilename}`;
34+
const downloadUrl = `https://s.defang.io/${archiveFilename}?x-defang-source=npm`;
3735
const downloadTargetFile = path.join(outputPath, archiveFilename);
3836

3937
return await downloadFile(downloadUrl, downloadTargetFile);
@@ -291,7 +289,6 @@ export async function install(
291289
const filename = getAppArchiveFilename(version, os.platform, os.arch);
292290

293291
const archiveFile = await downloadAppArchive(
294-
version,
295292
filename,
296293
saveDirectory
297294
);

pkgs/winget/DefangLabs.defang.installer.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkgs/winget/DefangLabs.defang.locale.en-US.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

pkgs/winget/DefangLabs.defang.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/.goreleaser.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ winget:
109109
- publisher: DefangLabs
110110
name: Defang
111111
short_description: The Defang command-line interface (CLI)
112-
description: Defang is the easiest way for developers to create and deploy their containerized applications to the cloud.
112+
description: Defang is the easiest way to develop, deploy, and debug cloud applications.
113+
copyright: Defang Software Labs Inc.
114+
url_template: https://s.defang.io/defang_{{ .Version }}_{{ .Os }}_{{ .Arch }}.zip?x-defang-source=winget
113115
license: MIT
114116
publisher_url: https://defang.io/
115117
homepage: https://github.com/DefangLabs/defang/

src/bin/install

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,24 @@ fi
2828
if [[ -z "$DEFANG_INSTALL_VERSION" ]]; then
2929
RELEASE_PATH="latest"
3030
else
31-
RELEASE_PATH="tags/$DEFANG_INSTALL_VERSION"
31+
RELEASE_PATH="tags/v${DEFANG_INSTALL_VERSION#v}"
3232
fi
3333

34-
# Echo fetching the release path either latest or strip the tags/ from the version
35-
echo "Fetching the ${DEFANG_INSTALL_VERSION:-latest} release of defang..."
36-
RELEASE_JSON=$(curl -s -f -L https://api.github.com/repos/DefangLabs/defang/releases/$RELEASE_PATH)
34+
# Anonymous API request to GitHub are rate limited to 60 requests per hour.
35+
# Check whether the user has set a GitHub token to increase the rate limit.
36+
AUTH_HEADER=""
37+
if [[ -n "$GITHUB_TOKEN" ]]; then
38+
AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
39+
elif [[ -n "$GH_TOKEN" ]]; then
40+
AUTH_HEADER="Authorization: Bearer $GH_TOKEN"
41+
fi
42+
43+
# Echo fetching the release path either latest or the version
44+
echo "Fetching the ${RELEASE_PATH#tags/} release of defang..."
45+
# Download the release information from GitHub, using the token if available, but falling back to anonymous access
46+
RELEASE_JSON=$([[ -n "$AUTH_HEADER" ]] &&
47+
curl -sfL -H "$AUTH_HEADER" https://api.github.com/repos/DefangLabs/defang/releases/$RELEASE_PATH ||
48+
curl -sfL https://api.github.com/repos/DefangLabs/defang/releases/$RELEASE_PATH)
3749

3850
# Check for curl failure
3951
if [ -z "$RELEASE_JSON" ]; then
@@ -80,7 +92,7 @@ elif [ "$OS" = "Linux" ]; then
8092
fi
8193

8294
# Download the file
83-
if ! curl -s -f -L "$DOWNLOAD_URL" -o "$FILENAME"; then
95+
if ! curl -sfL "$DOWNLOAD_URL" -o "$FILENAME"; then
8496
echo "Download failed. Please check your internet connection and try again."
8597
return 4
8698
fi
@@ -239,5 +251,5 @@ rm "$FILENAME"
239251
echo "Installation completed. You can now use defang by typing '$BINARY_NAME' in the terminal."
240252

241253
# Unset the variables and functions to avoid polluting the user's environment
242-
unset EXTRACT_DIR DOWNLOAD_URL RELEASE_JSON RELEASE_PATH ARCH_SUFFIX ARCH OS FILENAME INSTALL_DIR BINARY_NAME REPLY EXPORT_PATH CURRENT_SHELL FOUND_PROFILE_FILE
254+
unset EXTRACT_DIR DOWNLOAD_URL RELEASE_JSON RELEASE_PATH ARCH_SUFFIX ARCH OS FILENAME INSTALL_DIR BINARY_NAME REPLY EXPORT_PATH CURRENT_SHELL FOUND_PROFILE_FILE AUTH_HEADER
243255
unset -f _prompt_and_append_to_file _generate_completion_script _install_completion_script

0 commit comments

Comments
 (0)