Skip to content

Commit

Permalink
Bulk removal of ODK stuff and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnR committed Apr 1, 2020
1 parent 75de4b9 commit f2ec0a5
Show file tree
Hide file tree
Showing 720 changed files with 167 additions and 18,672 deletions.
168 changes: 4 additions & 164 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,5 @@
version: 2
version: 3
jobs:
build-odk1:
working_directory: ~/work
docker:
- image: circleci/python:latest
steps:
- checkout
- run:
name: Install checkout requirements
command: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
- run:
name: Checkout binaries
command: git lfs pull
- run:
name: Install build requirements
command: |
sudo apt-get install pngquant
sudo apt-get install python-enchant
sudo pip install -r requirements.txt
- run:
name: Style Guide Check
command: |
paths=$(git diff origin/master... --name-only)
echo $paths
sudo python style-test.py $paths -r odk1-src
sudo python style-test.py $paths -r shared-src
- run:
name: Build ODK1 Documentation
command: make odk1-deploy
- run:
name: Check spelling of ODK1 Documentation
command: make odk1-spell-check
- run:
name: Build LaTex of ODK1 Documentation
command: make odk1-latex
- run:
name: Compress images
command: pngquant odk1-build/_images/*.png --force --ext .png --verbose
- store_artifacts:
path: odk1-build
destination: odk1-build
- persist_to_workspace:
root: ~/work
paths:
- odk1-build/*
- odk1-config/*
build-pdf-odk1:
working_directory: ~/work
docker:
- image: schickling/latex
steps:
- attach_workspace:
at: ~/work
- run:
name: Build PDF
command: |
cd odk1-build/latex
xelatex OpenDataKit.tex
xelatex OpenDataKit.tex
mkdir -p ../_downloads
mv OpenDataKit.pdf ../_downloads/ODK-Documentation.pdf
- store_artifacts:
path: odk1-build/_downloads/ODK-Documentation.pdf
destination: ODK-Documentation.pdf
- persist_to_workspace:
root: ~/work
paths:
- odk1-build/*
build-odkx:
working_directory: ~/work
docker:
Expand Down Expand Up @@ -140,102 +70,12 @@ jobs:
root: ~/work
paths:
- odkx-build/*
deploy-odk1:
working_directory: ~/work
docker:
- image: circleci/ruby:latest
steps:
- attach_workspace:
at: ~/work
- run:
name: Install deploy requirements
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
sudo apt-get install -y software-properties-common
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update
sudo apt-get install -y adoptopenjdk-8-hotspot
gem install s3_website && s3_website install
fi
- run:
name: Push to S3
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
s3_website push --config-dir=odk1-config
fi
deploy-odkx:
working_directory: ~/work
docker:
- image: circleci/ruby:latest
steps:
- attach_workspace:
at: ~/work
- run:
name: Install deploy requirements
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
sudo apt-get install -y software-properties-common
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update
sudo apt-get install -y adoptopenjdk-8-hotspot
gem install s3_website && s3_website install
fi
- run:
name: Push to S3
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
s3_website push --config-dir=odkx-config
fi
deploy-shared:
working_directory: ~/work
docker:
- image: circleci/ruby:latest
steps:
- attach_workspace:
at: ~/work
- run:
name: Install deploy requirements
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
sudo apt-get install -y software-properties-common
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update
sudo apt-get install -y adoptopenjdk-8-hotspot
gem install s3_website && s3_website install
fi
- run:
name: Push to S3
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "opendatakit" ]]; then \
s3_website push --config-dir=shared-config
fi

workflows:
version: 2
build_deploy:
version: 3
build:
jobs:
- build-odk1
- build-pdf-odk1:
requires:
- build-odk1
- build-odkx
- build-pdf-odkx:
requires:
- build-odkx
- deploy-odk1:
requires:
- build-odk1
- build-pdf-odk1
filters:
branches:
only: master
- deploy-odkx:
requires:
- build-odkx
- build-pdf-odkx
filters:
branches:
only: master
52 changes: 4 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = OpenDataKit
ODK1_SRCDIR = odk1-src
SPHINXPROJ = ODKX
ODKX_SRCDIR = odkx-src
SHARED_SRCDIR = shared-src
COMPILE1_SRCDIR = tmp1-src
COMPILE_X_SRCDIR = tmpx-src
ODK1_BUILDDIR = odk1-build
ODKX_BUILDDIR = odkx-build

# Put it first so that "make" without argument is like "make help".
Expand All @@ -19,95 +17,53 @@ help:

.PHONY: help Makefile

odk1-autobuild:
sphinx-autobuild --poll -p 8080 -H 0.0.0.0 odk1-src odk1-build

odkx-autobuild:
sphinx-autobuild --poll -p 8080 -H 0.0.0.0 odkx-src odkx-build

odk1-clean:
rm -rf $(COMPILE1_SRCDIR)
rm -rf $(ODK1_BUILDDIR)

odkx-clean:
rm -rf $(COMPILE_X_SRCDIR)
rm -rf $(ODKX_BUILDDIR)

odk1-clean-files:
rm -rf $(COMPILE1_SRCDIR)
rm -rf $(ODK1_BUILDDIR)/*

odkx-clean-files:
rm -rf $(COMPILE_X_SRCDIR)
rm -rf $(ODKX_BUILDDIR)/*

clean: odk1-clean odkx-clean

odk1-copy: odk1-clean-files
mkdir $(COMPILE1_SRCDIR)
cp -rf $(ODK1_SRCDIR)/* $(COMPILE1_SRCDIR)
cp -rf $(SHARED_SRCDIR)/* $(COMPILE1_SRCDIR)
clean: odkx-clean

odkx-copy: odkx-clean-files
mkdir $(COMPILE_X_SRCDIR)
cp -rf $(ODKX_SRCDIR)/* $(COMPILE_X_SRCDIR)
cp -rf $(SHARED_SRCDIR)/* $(COMPILE_X_SRCDIR)

odk1: odk1-copy
@$(SPHINXBUILD) -b dirhtml "$(COMPILE1_SRCDIR)" "$(ODK1_BUILDDIR)" $(SPHINXOPTS)

odkx: odkx-copy
@$(SPHINXBUILD) -b dirhtml "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)" $(SPHINXOPTS)

odk1-deploy: odk1-copy
@$(SPHINXBUILD) -W -b dirhtml "$(COMPILE1_SRCDIR)" "$(ODK1_BUILDDIR)" $(SPHINXOPTS)

odkx-deploy: odkx-copy
@$(SPHINXBUILD) -W -b dirhtml "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)" $(SPHINXOPTS)

build-all: odk1 odkx

odk1-latex: odk1
@$(SPHINXBUILD) -b latex "$(COMPILE1_SRCDIR)" "$(ODK1_BUILDDIR)"/latex $(SPHINXOPTS)
python util/resize.py "$(ODK1_BUILDDIR)"
build-all: odkx

odkx-latex: odkx
@$(SPHINXBUILD) -b latex "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)"/latex $(SPHINXOPTS)
python util/resize.py "$(ODKX_BUILDDIR)"

odk1-pdf: odk1-latex
cd "$(ODK1_BUILDDIR)"/latex && \
xelatex OpenDataKit.tex && \
xelatex OpenDataKit.tex && \
mkdir -p ../_downloads && \
mv OpenDataKit.pdf ../_downloads/ODK-Documentation.pdf

odkx-pdf: odkx-latex
cd "$(ODKX_BUILDDIR)"/latex && \
xelatex OpenDataKitX.tex && \
xelatex OpenDataKitX.tex && \
mkdir -p ../_downloads && \
mv OpenDataKitX.pdf ../_downloads/ODK-X-Documentation.pdf

odk1-style-check: odk1
python style-test.py -r $(COMPILE1_SRCDIR)

odk1-spell-check: odk1
sphinx-build -b spelling $(COMPILE1_SRCDIR) $(ODK1_BUILDDIR)/spelling
python util/check-spelling-output.py $(ODK1_BUILDDIR)

odkx-style-check: odkx
python style-test.py -r $(COMPILE_X_SRCDIR)

odkx-spell-check: odkx
sphinx-build -b spelling $(COMPILE_X_SRCDIR) $(ODKX_BUILDDIR)/spelling
python util/check-spelling-output.py $(ODKX_BUILDDIR)

odk1-check: odk1-style-check odk1-spell-check

odkx-check: odkx-style-check odkx-spell-check

check-all: odk1-check odkx-check
check-all: odkx-check

test:
pytest
Loading

0 comments on commit f2ec0a5

Please sign in to comment.