diff --git a/.circleci/config.yml b/.circleci/config.yml index 21ee9e88957..edb71cd16af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,12 @@ -# Python CircleCI 2.0 configuration file +# Python CircleCI 2.1 configuration file # # Check https://circleci.com/docs/2.0/language-python/ for more details # -version: 2 -jobs: - build: - working_directory: ~/web +version: 2.1 + +executors: + gitcoin-latest: docker: - # specify the version you desire here - # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - image: gitcoin/web:latest environment: CACHE_URL: dbcache://my_cache_table @@ -17,17 +15,21 @@ jobs: CACHEOPS_REDIS: redis://localhost:6379/0 ENV: test COLLECTFAST_CACHE_URL: dbcache://collectfast + working_directory: ~/web - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - - image: circleci/postgres:9-alpine +jobs: + test: + executor: gitcoin-latest + branches: + ignore: + - gh-pages + docker: + - image: circleci/postgres:10-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: testdb - - - image: redis:4.0-alpine + - image: circleci/redis:4-alpine3.8 steps: - checkout @@ -42,8 +44,6 @@ jobs: - run: name: install dependencies command: | - echo "Using Python: $(which python)" - echo "Working Directory: $PWD" python -m venv venv echo "Activating virtualenv..." . venv/bin/activate @@ -58,11 +58,6 @@ jobs: - "/usr/local/bin" - "/usr/local/lib/python3.7/site-packages" - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io - run: name: run tests command: | @@ -71,8 +66,10 @@ jobs: cd ~/web/app echo "Running pytest..." pytest -p no:ethereum + - store_test_results: path: test-results + - store_artifacts: path: test-results destination: test-results diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index e0a21713e2a..0f16dd1f523 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -1216,7 +1216,8 @@ const process_activities = function(result, bounty_activities) { bounty_removed_slashed_by_staff: gettext('Dinged and Removed from Bounty by Staff'), bounty_removed_by_staff: gettext('Removed from Bounty by Staff'), bounty_removed_by_funder: gettext('Removed from Bounty by Funder'), - bounty_changed: gettext('Bounty Details Changed') + bounty_changed: gettext('Bounty Details Changed'), + extend_expiration: gettext('Extended Bounty Expiration') }; const now = new Date(result['now']); diff --git a/bin/deploy-gh-pages.bash b/bin/deploy-gh-pages.bash new file mode 100755 index 00000000000..38b728a7f8f --- /dev/null +++ b/bin/deploy-gh-pages.bash @@ -0,0 +1,62 @@ +#!/bin/bash +set -e + +# Establish base configuration variables. +CI_SKIP_MSG=${CI_SKIP_MSG:-'[CI SKIP]'} +REMOTE_ORIGIN_URL=$(git config remote.origin.url) + +DOCS_BRANCH=${DOCS_BRANCH:-'gh-pages'} +DOCS_BUILD_DIR=${DOCS_BUILD_DIR:-'_build/site'} +DOCS_DIR_PREFIX=${DOCS_DIR_PREFIX:-'tmp-dir'} +DOCS_ORIGIN_DESIGNATOR=${DOCS_ORIGIN_DESIGNATOR:-'origin'} +DOCS_TMP_DIR=$DOCS_BRANCH-$DOCS_DIR_PREFIX +GH_COMMIT_MSG=${GH_COMMIT_MSG:-'Deploy Github Pages'} + +echo "Deploying Documentation to Github Pages!" +echo "Remote Origin URL: ($REMOTE_ORIGIN_URL)" +echo "Documentation Build Directory: ($DOCS_BUILD_DIR)" +echo "Documentation Branch: ($DOCS_BRANCH)" +echo "Documentation Temporary Directory: ($DOCS_TMP_DIR)" + +# Verify the Github email and name have been specified. +: "${GH_EMAIL:?You must set the GH_EMAIL environment variable}" +: "${GH_NAME:?You must set the GH_NAME environment variable}" + +# Make the intermediate directory. +echo "Creating the temporary documentation directory: $DOCS_TMP_DIR" +mkdir "$DOCS_TMP_DIR" +cd "$DOCS_TMP_DIR" || exit 1 + +# Git configuration and initialization. +git config --global user.email "$GH_EMAIL" > /dev/null 2>&1 +git config --global user.name "$GH_NAME" > /dev/null 2>&1 +git init +git remote add --fetch "$DOCS_ORIGIN_DESIGNATOR" "$REMOTE_ORIGIN_URL" + +# Check for revisions - if none don't do this since git rm bombs otherwise. +if git rev-parse --verify "$DOCS_ORIGIN_DESIGNATOR"/"$DOCS_BRANCH" > /dev/null 2>&1; then + # Switch into the $DOCS_BRANCH branch. + git checkout "$DOCS_BRANCH" + # Delete any old site as we are going to replace it. + git rm -rf . +else + git checkout --orphan "$DOCS_BRANCH" +fi + +# Copy the documentation page assets into the root project directory. +cp -a "../${DOCS_BUILD_DIR}/." . + +# Stage all changes. +git add -A + +# Commit updated documentation assets and instruct to skip CI. +git commit --allow-empty -m "$GH_COMMIT_MSG - $CI_SKIP_MSG" + +# Force push documentation changes overtop of the $DOCS_BRANCH branch and ignore output. +git push --force --quiet "$DOCS_ORIGIN_DESIGNATOR" "$DOCS_BRANCH" > /dev/null 2>&1 +echo "Documentation update pushed to $DOCS_BRANCH!" + +# Cleanup temporary assets. +cd .. || exit 1 +rm -rf "$DOCS_TMP_DIR" +echo "Github Pages Deployed!"