-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
az-repo-apt-add: build and update Azure Storage based repo + tests fo…
…r it
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh -e | ||
|
||
# Needs AZURE_STORAGE_SAS_TOKEN to be set | ||
|
||
AZ_STORAGE_ACCOUNT=packageskaitai | ||
AZ_STORAGE_CONTAINER=test3 | ||
REPO_DIR=repo0 | ||
PKGS_SRC=all_pkgs/*.deb | ||
|
||
#az storage blob list --account-name "$AZ_STORAGE_ACCOUNT" --container-name "$AZ_STORAGE_CONTAINER" | ||
|
||
download_existing_repo() | ||
{ | ||
echo "## Downloading existing repo" | ||
mkdir -p "$REPO_DIR/dists/stable/main/binary-all" | ||
az storage blob download \ | ||
--account-name "$AZ_STORAGE_ACCOUNT" \ | ||
--container-name "$AZ_STORAGE_CONTAINER" \ | ||
--name "dists/stable/main/binary-all/Packages.gz" \ | ||
--file "$REPO_DIR/dists/stable/main/binary-all/Packages.gz" | ||
} | ||
|
||
upload_repo() | ||
{ | ||
echo "## Uploading repo" | ||
az storage blob upload-batch \ | ||
--account-name "$AZ_STORAGE_ACCOUNT" \ | ||
--destination "$AZ_STORAGE_CONTAINER" \ | ||
--overwrite \ | ||
--source "$REPO_DIR" | ||
} | ||
|
||
download_existing_repo || : | ||
|
||
export REPO_DIR | ||
export PKGS_SRC | ||
./docker-repo-apt-handle | ||
|
||
upload_repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh -ef | ||
|
||
SCRIPT_DIR=$(dirname $0) | ||
. "$SCRIPT_DIR/common.sh" | ||
|
||
docker_run ./test-pkg-install-az |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh -e | ||
# Tests installation and runnability of a `kaitai-struct-compiler` package from a local repository | ||
|
||
apt-get update | ||
apt-get install -y ca-certificates | ||
|
||
: "${REPO_DIR:=repo0}" | ||
GPG_PUB_KEY_FILE=gpg/repo-pubkey.asc | ||
|
||
cat "$GPG_PUB_KEY_FILE" | apt-key add - | ||
|
||
echo "deb [arch=all] https://packages.kaitai.io/test3 stable main" | tee /etc/apt/sources.list.d/kaitai-test-az.list | ||
|
||
#apt-get update --allow-insecure-repositories | ||
#apt-get install -y --allow-unauthenticated kaitai-struct-compiler | ||
|
||
apt-get update | ||
apt-get install -y kaitai-struct-compiler default-jre-headless | ||
|
||
kaitai-struct-compiler --version |