-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix copy script - moved as single script used in correctness check script. Add this copy script to travis docs check. Adjust scripts to pass shellcheck. closes: #7176 https://pulp.plan.io/issues/7176
- Loading branch information
1 parent
6244263
commit 64c60dd
Showing
21 changed files
with
2,081 additions
and
16,401 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
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 @@ | ||
Fix copy script example typos. |
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
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
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get an RPM package | ||
curl -O https://fixtures.pulpproject.org/rpm-unsigned/squirrel-0.1-1.noarch.rpm | ||
export PKG="squirrel-0.1-1.noarch.rpm" | ||
if [[ -n "$1" ]]; then | ||
export REMOTE_FILE="$1" | ||
else | ||
export REMOTE_FILE="https://fixtures.pulpproject.org/rpm-signed/squirrel-0.1-1.noarch.rpm" | ||
fi | ||
curl -O "$REMOTE_FILE" | ||
PKG="$(basename $REMOTE_FILE)" | ||
export PKG | ||
|
||
# Upload it as an Artifact | ||
echo "Upload an RPM package." | ||
export ARTIFACT_HREF=$(http --form POST $BASE_ADDR/pulp/api/v3/artifacts/ \ | ||
file@./$PKG | jq -r '.pulp_href') | ||
ARTIFACT_HREF=$(http --form POST "$BASE_ADDR"/pulp/api/v3/artifacts/ \ | ||
file@./"$PKG" | jq -r '.pulp_href') | ||
export ARTIFACT_HREF | ||
|
||
echo "Inspecting artifact." | ||
http $BASE_ADDR$ARTIFACT_HREF | ||
http "$BASE_ADDR""$ARTIFACT_HREF" |
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
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Add content unit to the repository | ||
echo "Add and then remove content from repository." | ||
TASK_URL=$(http POST "$BASE_ADDR""$REPO_HREF"'modify'/ add_content_units:="[\"$PACKAGE_HREF\"]" | jq -r '.task') | ||
wait_until_task_finished "$BASE_ADDR""$TASK_URL" | ||
REPOVERSION_HREF_WITH_PKG=$(http "$BASE_ADDR""$TASK_URL" | jq -r '.created_resources | first') | ||
export REPOVERSION_HREF_WITH_PKG | ||
|
||
# Remove content units from the repository | ||
http POST "$BASE_ADDR""$REPO_HREF"'modify'/ remove_content_units:="[\"$PACKAGE_HREF\"]" | ||
|
||
# Clone a repository (can be composed with addition or removal of units) | ||
echo "Clone a repository with a content." | ||
TASK_URL=$(http POST "$BASE_ADDR""$REPO_HREF"'modify'/ \ | ||
base_version="$REPOVERSION_HREF_WITH_PKG" | jq -r '.task') | ||
|
||
# Poll the task (here we use a function defined in docs/_scripts/base.sh) | ||
wait_until_task_finished "$BASE_ADDR""$TASK_URL" | ||
|
||
# After the task is complete, it gives us a new repository version | ||
echo "Set REPOVERSION_HREF from finished task." | ||
REPOVERSION_HREF=$(http "$BASE_ADDR""$TASK_URL"| jq -r '.created_resources | first') | ||
export REPOVERSION_HREF | ||
|
||
echo "Inspecting RepositoryVersion." | ||
http "$BASE_ADDR""$REPOVERSION_HREF" |
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
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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script will execute the component scripts and ensure that the documented examples | ||
# work as expected. | ||
|
||
# NOTE: These scripts use httpie, jq, curl and requires a .netrc for authentication with Pulp | ||
|
||
# From the _scripts directory, run with `source docs_check_copy.sh` (source to preserve | ||
# the environment variables) | ||
|
||
export REPO_NAME="copy-repo" | ||
export DIST_NAME="copy-dist" | ||
export REMOTE_ARTIFACT="https://fixtures.pulpproject.org/rpm-signed/shark-0.1-1.noarch.rpm" | ||
|
||
source base.sh | ||
source repo.sh "$REPO_NAME" | ||
|
||
source artifact.sh $REMOTE_ARTIFACT | ||
source package.sh | ||
source copy_basic.sh | ||
|
||
source publication.sh | ||
source distribution.sh "$DIST_NAME" | ||
source download.sh |
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
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
BASE_URL=$(http ${BASE_ADDR}${DISTRIBUTION_HREF} | jq -r '.base_url') | ||
BASE_PATH=$(http ${BASE_ADDR}${DISTRIBUTION_HREF} | jq -r '.base_path') | ||
PUBLIC_KEY_URL=${BASE_URL}/repodata/public.key | ||
BASE_URL=$(http "$BASE_ADDR""$DISTRIBUTION_HREF" | jq -r '.base_url') | ||
BASE_PATH=$(http "$BASE_ADDR""$DISTRIBUTION_HREF" | jq -r '.base_path') | ||
PUBLIC_KEY_URL="$BASE_URL"/repodata/public.key | ||
|
||
echo "Setting up a YUM repository." | ||
sudo dnf config-manager --add-repo ${BASE_URL} | ||
sudo dnf config-manager --add-repo "$BASE_URL" | ||
sudo dnf config-manager --save \ | ||
--setopt=*${BASE_PATH}.gpgcheck=0 \ | ||
--setopt=*${BASE_PATH}.repo_gpgcheck=1 \ | ||
--setopt=*${BASE_PATH}.gpgkey=${PUBLIC_KEY_URL} | ||
--setopt=*"$BASE_PATH".gpgcheck=0 \ | ||
--setopt=*"$BASE_PATH".repo_gpgcheck=1 \ | ||
--setopt=*"$BASE_PATH".gpgkey="$PUBLIC_KEY_URL" | ||
|
||
sudo dnf install -y walrus |
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
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
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
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
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
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
Oops, something went wrong.