mirror of
https://github.com/kopia/kopia.git
synced 2026-10-20 05:14:00 -04:00
travis: generate repository snapshot for long-term storage
This is triggered for tagged releases and will be used later for long-term repository compatibility testing.
This commit is contained in:
1 parent
2e0f75178e
commit
671a63aa24
4 files changed
+60
-1
No files matched your search
@@ -1,6 +1,7 @@
|
||||
.DS_Store
|
||||
.release/
|
||||
.releases/
|
||||
compat-test/
|
||||
playground/
|
||||
kopia-*.tar.gz
|
||||
kopia-*.zip
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ install: make travis-setup
|
||||
script: make travis-release
|
||||
deploy:
|
||||
- provider: script
|
||||
script: curl -sL https://git.io/goreleaser | bash /dev/stdin --rm-dist
|
||||
script: make tagged-release
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
|
||||
@@ -59,6 +59,11 @@ travis-release: test-with-coverage lint vet verify-release integration-tests upl
|
||||
verify-release:
|
||||
curl -sL https://git.io/goreleaser | bash /dev/stdin --skip-publish --skip-sign --rm-dist --snapshot
|
||||
|
||||
tagged-release:
|
||||
curl -sL https://git.io/goreleaser | bash /dev/stdin --rm-dist
|
||||
# this is a no-op for PRs and non-tagged releses
|
||||
$(MAKE) travis-create-long-term-repository
|
||||
|
||||
ifeq ($(TRAVIS_PULL_REQUEST),false)
|
||||
|
||||
upload-coverage: $(GOVERALLS_TOOL)
|
||||
@@ -131,6 +136,10 @@ travis-install-test-credentials:
|
||||
openssl aes-256-cbc -K "$(encrypted_fa1db4b894bb_key)" -iv "$(encrypted_fa1db4b894bb_iv)" -in tests/credentials/sftp/id_kopia.enc -out repo/blob/sftp/id_kopia -d
|
||||
openssl aes-256-cbc -K "$(encrypted_fa1db4b894bb_key)" -iv "$(encrypted_fa1db4b894bb_iv)" -in tests/credentials/sftp/known_hosts.enc -out repo/blob/sftp/known_hosts -d
|
||||
|
||||
travis-install-cloud-sdk: travis-install-test-credentials
|
||||
if [ ! -d $(HOME)/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash; fi
|
||||
$(HOME)/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file repo/blob/gcs/test_service_account.json
|
||||
|
||||
else
|
||||
|
||||
travis-install-gpg-key:
|
||||
@@ -139,4 +148,20 @@ travis-install-gpg-key:
|
||||
travis-install-test-credentials:
|
||||
@echo Not installing test credentials.
|
||||
|
||||
travis-install-cloud-sdk:
|
||||
@echo Not installing Cloud SDK.
|
||||
|
||||
endif
|
||||
|
||||
ifneq ($(TRAVIS_TAG),)
|
||||
|
||||
travis-create-long-term-repository: dist-binary travis-install-cloud-sdk
|
||||
echo Creating long-term repository $(TRAVIS_TAG)...
|
||||
KOPIA_EXE=$(CURDIR)/dist/integration/kopia ./tests/compat_test/gen-compat-repo.sh
|
||||
|
||||
else
|
||||
|
||||
travis-create-long-term-repository:
|
||||
echo Not creating long-term repository.
|
||||
|
||||
endif
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [[ $TRAVIS_TAG == "" ]]; then
|
||||
echo TRAVIS_TAG must be set.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $KOPIA_EXE == "" ]]; then
|
||||
echo KOPIA_EXE must be set.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OUTPUT_DIR="compat-test/$TRAVIS_TAG"
|
||||
rm -rf "$OUTPUT_DIR"
|
||||
|
||||
mkdir -pv "$OUTPUT_DIR"
|
||||
TMP_DIR=$(mktemp -d)
|
||||
mkdir -pv $TMP_DIR/{config,repo}
|
||||
export KOPIA_PASSWORD=long-term-test
|
||||
KOPIA_ARGS="--analytics-consent=disagree --config-file=$TMP_DIR/config/kopia.config"
|
||||
$KOPIA_EXE $KOPIA_ARGS repository create filesystem --path "$TMP_DIR/repo"
|
||||
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create repo
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create cli
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create site
|
||||
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create repo
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create cli
|
||||
$KOPIA_EXE $KOPIA_ARGS snap create site
|
||||
(cd $TMP_DIR && tar cf - "repo/") > "$OUTPUT_DIR/repo.tar"
|
||||
cp dist/*.tar.gz "$OUTPUT_DIR"
|
||||
rm -rf "$TMP_DIR"
|
||||
gsutil cp -rv $OUTPUT_DIR gs://kopia-compat-test/
|
||||
Reference in new issue
Block a user