Skip to content

Commit

Permalink
Merge pull request #1661 from pavelpicka/6312-docs-workflow-update
Browse files Browse the repository at this point in the history
Independent docs script
  • Loading branch information
goosemania committed Apr 21, 2020
2 parents ee108c1 + 722b9aa commit 613aede
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES/6312.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Docs check scripts can run together.
4 changes: 2 additions & 2 deletions docs/_scripts/artifact.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

# Get an RPM package
curl -O https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm/fox-1.1-2.noarch.rpm
export PKG="fox-1.1-2.noarch.rpm"
curl -O https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-signed/squirrel-0.1-1.noarch.rpm
export PKG="squirrel-0.1-1.noarch.rpm"

# Upload it as an Artifact
echo "Upload an RPM package."
Expand Down
9 changes: 8 additions & 1 deletion docs/_scripts/distribution.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env bash

# Variables
if [ $# -eq 0 ]; then
export BASE_PATH="foo"
else
export BASE_PATH="$1"
fi

# Create RPM distribution for publication
export TASK_URL=$(http POST $BASE_ADDR/pulp/api/v3/distributions/rpm/rpm/ \
name='baz' base_path='foo' publication=$PUBLICATION_HREF | jq -r '.task')
publication=$PUBLICATION_HREF name="$BASE_PATH" base_path="$REPO_NAME" | 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
Expand Down
7 changes: 5 additions & 2 deletions docs/_scripts/docs_check_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
# From the _scripts directory, run with `source docs_check_sync_publish.sh` (source to preserve the
# environment variables)

export REPO_NAME="sync-repo"
export DIST_NAME="sync-dist"

source base.sh

source repo.sh
source repo.sh "$REPO_NAME"
source remote.sh
source sync.sh

source publication.sh
source distribution.sh
source distribution.sh "$DIST_NAME"

source download.sh
7 changes: 5 additions & 2 deletions docs/_scripts/docs_check_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
# From the _scripts directory, run with `source docs_check_upload_publish.sh` (source to preserve
# the environment variables)

export REPO_NAME="upload-repo"
export DIST_NAME="upload-dist"

source base.sh
source repo.sh
source repo.sh "$REPO_NAME"

source artifact.sh
source package.sh
Expand All @@ -18,5 +21,5 @@ source advisory.sh
source copy.sh

source publication.sh
source distribution.sh
source distribution.sh "$DIST_NAME"
source download.sh
4 changes: 3 additions & 1 deletion docs/_scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Download a package

# Specify one package from repository used in 'remote.sh'
PKG="fox-1.1-2.noarch.rpm"
if [ -z "$PKG" ]; then
PKG="fox-1.1-2.noarch.rpm"
fi

# The distribution will return a url that can be used by http clients
echo "Setting DISTRIBUTION_BASE_URL, which is used to retrieve content from the content app."
Expand Down
6 changes: 5 additions & 1 deletion docs/_scripts/repo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/env bash

# Create RPM repository
export REPO_NAME="foo"
if [ $# -eq 0 ]; then
export REPO_NAME="foo"
else
export REPO_NAME="$1"
fi

echo "Creating a new repository named $REPO_NAME."
export REPO_HREF=$(http POST $BASE_ADDR/pulp/api/v3/repositories/rpm/rpm/ name=$REPO_NAME \
Expand Down
3 changes: 3 additions & 0 deletions docs/workflows/scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Each workflow renders bash scripts that allow the developers to ensure the conti
the instructions. These scripts may also be helpful to users as a basis for their own scripts. All
of the scripts can be found at https://github.com/pulp/pulp_rpm/tree/master/docs/_scripts/

Some scripts have conditional statements for setting REPO_NAME.
These are used by Pulp team for validity testing.

The following scripts are used in conjunction with all the workflow scripts:

**Base**
Expand Down

0 comments on commit 613aede

Please sign in to comment.