Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,46 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8.x
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
pip-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }}
pip-ubuntu-latest-py3.8-
- uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: virtualenvs-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
virtualenvs-ubuntu-latest-py3.8-${{ hashFiles('Pipfile.lock') }}
virtualenvs-ubuntu-latest-py3.8-
- run: pip install -U pipenv pip
- run: make deps
- run: make docs
- uses: actions/upload-artifact@v2
with:
name: docs
path: docs/site/
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-east-1
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: make sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DOCS_AWS_ID }}
aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: make promote-docs-in-s3
dispatch:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: distributions
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
VERSION := $(shell pipenv run python setup.py --version)
HOSTNAME := $(shell hostname)
BDIST_WHEEL := dist/rsconnect_python-$(VERSION)-py2.py3-none-any.whl
S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python

BDIST_WHEEL := dist/rsconnect_python-$(VERSION)-py2.py3-none-any.whl

RUNNER = docker run \
-it --rm \
-v $(PWD):/rsconnect \
Expand Down Expand Up @@ -125,7 +126,7 @@ fmt: fmt-3.8

.PHONY: docs
docs:
$(MAKE) -C docs
$(MAKE) -C docs VERSION=$(VERSION)

.PHONY: version
version:
Expand Down Expand Up @@ -154,3 +155,17 @@ sync-latest-to-s3:
--cache-control max-age=0 \
$(BDIST_WHEEL) \
$(S3_PREFIX)/latest/rsconnect_python-latest-py2.py3-none-any.whl

.PHONY: sync-latest-docs-to-s3
sync-latest-docs-to-s3:
aws s3 sync --delete --acl bucket-owner-full-control \
--cache-control max-age=0 \
docs/site/ \
$(S3_PREFIX)/latest/docs/

.PHONY: promote-docs-in-s3
promote-docs-in-s3:
aws s3 sync --delete --acl bucket-owner-full-control \
--cache-control max-age=300 \
docs/site/ \
s3://docs.rstudio.com/rsconnect-python/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,7 @@ to enable later redeployment. This data is stored alongside the deployed file,
in an `rsconnect-python` subdirectory, if possible. If that location is not writable
during deployment, then the deployment data will be stored in the global configuration
directory specified above.

<div style="display:none">
Generated from <code>rsconnect-python {{ rsconnect_python.version }}</code>
</div>
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.2-alpine3.11
FROM python:3.8-slim
MAINTAINER RStudio Connect <rsconnect@rstudio.com>

# Needed with Python3 mkdocs.
Expand Down
42 changes: 21 additions & 21 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Our make file for the docs.
MKDOCS_IMAGE?="rstudio/rsconnect:mkdocs"
MKDOCS_IMAGE ?= rstudio/rsconnect:mkdocs
VERSION ?= NOTSET

## Specify that Docker runs with the calling user's uid/gid to avoid file
## permission issues on Linux dev hosts.
DOCKER_RUN_AS=
DOCKER_RUN_AS =
ifeq (Linux,$(shell uname))
DOCKER_RUN_AS=-u $(shell id -u):$(shell id -g)
DOCKER_RUN_AS = -u $(shell id -u):$(shell id -g)
endif

BUILD_RUNNER=docker run --rm --name mkdocs \
${DOCKER_RUN_AS} \
-v $(CURDIR):/mkdocs \
-w /mkdocs \
${MKDOCS_IMAGE}
BUILD_RUNNER = \
docker run --rm --name mkdocs \
$(DOCKER_RUN_AS) \
-e VERSION=$(VERSION) \
-v $(CURDIR):/mkdocs \
-w /mkdocs \
$(MKDOCS_IMAGE)

# Do everything,
.PHONY: all
all: clean image build

# Destroy the site, if it exists.
.PHONY: clean
clean:
@rm -rf docs/site
rm -rf docs/site

# Build the image in which mkdocs will run.
.PHONY: image
image:
docker build -t ${MKDOCS_IMAGE} .
docker build -t $(MKDOCS_IMAGE) .

# Build the actual documentation.
build:
python patch_admonitions.py
${BUILD_RUNNER} mkdocs build
.PHONY: build
build: docs/index.md
$(BUILD_RUNNER) mkdocs build
@rm docs/index.md

.PHONY: clean image build
docs/index.md: $(CURDIR)/../README.md
python patch_admonitions.py
4 changes: 4 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ theme:

extra_css:
- css/custom.css

extra:
rsconnect_python:
version: !!python/object/apply:os.getenv ["VERSION"]