Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging #3105

Closed
wants to merge 4 commits into from
Closed

Staging #3105

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
2 changes: 1 addition & 1 deletion db-pg/scripts/backup-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export $(xargs < secrets/sausage-prod-db.env)
echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass
chmod 600 ~/.pgpass

prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump"
prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump"
pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [[ -f $dev_db_dump_file && -s $dev_db_dump_file ]]; then

echo "Backup electoral boundaries table from production (host=$DB_HOST)"

prod_db_dump_file="digitalocean_db-a_electoralboundaries_${DB_SCHEMA}_${now}.dump"
prod_db_dump_file="aws-db_electoralboundaries_${DB_SCHEMA}_${now}.dump"
table_name="app_electoralboundaries"

pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA --table $DB_SCHEMA.$table_name --verbose $DB_NAME > $prod_db_dump_file
Expand Down
2 changes: 1 addition & 1 deletion db-pg/scripts/replace-dev-with-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export $(xargs < secrets/sausage-prod-db.env)
echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass
chmod 600 ~/.pgpass

prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump"
prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump"
pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file

DB_HOST=
Expand Down
2 changes: 1 addition & 1 deletion db-pg/scripts/replace-staging-with-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export $(xargs < secrets/sausage-prod-db.env)
echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass
chmod 600 ~/.pgpass

prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump"
prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump"
pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file

DB_HOST=
Expand Down
1 change: 1 addition & 0 deletions django/demsausage/app/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def get_map_screenshot(election):
# firefox_options.add_argument("--start-fullscreen")
# firefox_options.add_argument("--start-maximized")
firefox_options.binary_location = '/usr/lib/firefox-esr/firefox-esr'
firefox_options.set_preference("general.useragent.override", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0; Demsausage-Webdriver-Screenshot-Service")

if os.path.isfile('/app/logs/webdriver/geckodriver.log') is False:
Path('/app/logs/webdriver/').mkdir(parents=True, exist_ok=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Election } from '../../app/services/elections';
import { getAPIBaseURL, getBaseURL } from '../../app/utils';

export const isEmbedModeActive = () => navigator.userAgent.includes('Demsausage-Webdriver-Screenshot-Service');

export const getEmbedStaticMapImageURL = (election: Election) => `${getAPIBaseURL()}/0.1/map_image/${election.id}/`;

// export const embedPrecannedMapBboxes = [
Expand Down
3 changes: 2 additions & 1 deletion public-redesign/src/features/map/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { getAPIBaseURL, getBaseURL } from '../../app/utils';
import { selectMapFilterSettings, setPollingPlaces } from '../app/appSlice';
import { getDefaultElection, getViewForElection } from '../elections/electionHelpers';
import { selectAllElections, selectElectionById } from '../elections/electionsSlice';
import { isEmbedModeActive } from '../embedBuilder/embedBuilderHelpers';
import { getPollingPlaceIdsFromFeatures } from '../pollingPlaces/pollingPlaceHelpers';
import SearchBarCosmeticNonFunctional from '../search/searchByAddressOrGPS/searchBar/searchBarCosmeticNonFunctional';
import AddStallButton from './addStallButton/addStallButton';
Expand Down Expand Up @@ -265,7 +266,7 @@ function Map(props: Props) {
<SearchBarCosmeticNonFunctional />
</Box>

<MapWelcomeToTheNewWebsite />
{isEmbedModeActive() === false && <MapWelcomeToTheNewWebsite />}

<Backdrop sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }} open={isMapDataLoading}>
<CircularProgress color="inherit" />
Expand Down
2 changes: 1 addition & 1 deletion scrapers/nsw_lg_2024/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from selenium.webdriver.firefox.service import Service
from webdriver_manager.firefox import GeckoDriverManager

USE_CACHE = True
USE_CACHE = False
OUTPUT_FILE = f'nsw-{datetime.date.today().isoformat()}.csv'
INDEX_PAGE = 'https://elections.nsw.gov.au/elections/find-my-electorate'

Expand Down
Loading