-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pvcy/jc/add-user-pagination-controls
Add pagination controls to user list
- Loading branch information
Showing
6 changed files
with
249 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,47 @@ on: | |
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
anonymize: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Anonymize Data | ||
uses: pvcy/anonymize-project@latest | ||
with: | ||
project-id: 4e1213f4-my-project-uuid-0242ac120002 | ||
db-host: my_postgres_host.host.com | ||
db-port: 5432 | ||
db-username: postgres_username | ||
db-password: postgres_password | ||
client-id: ClientIDFromYourPDAccount | ||
client-secret: ClientSecretFromYourPDAccount | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Google Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
with: | ||
project_id: database-migration-anonymized | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
export_default_credentials: true | ||
|
||
- name: Build and Push Docker Image | ||
run: | | ||
cd ./db | ||
docker build -t destination-db . | ||
gcloud auth configure-docker | ||
docker tag destination-db:latest gcr.io/database-migration-anonymized/destination-db | ||
docker push gcr.io/database-migration-anonymized/destination-db | ||
- name: Deploy to CloudRun | ||
run: | | ||
gcloud run deploy my-pg-service --image=gcr.io/database-migration-anonymized/destination-db --platform managed --allow-unauthenticated | ||
# anonymize: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Anonymize Data | ||
# uses: pvcy/anonymize-project@latest | ||
# with: | ||
# project-id: 4e1213f4-my-project-uuid-0242ac120002 | ||
# db-host: my_postgres_host.host.com | ||
# db-port: 5432 | ||
# db-username: postgres_username | ||
# db-password: postgres_password | ||
# client-id: ClientIDFromYourPDAccount | ||
# client-secret: ClientSecretFromYourPDAccount | ||
# dump-database: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Dump database to blob storage | ||
# run: | | ||
# some bash command to call pgdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: Create Preview and Test Migration | |
on: | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'users-api/src/migrations/**' | ||
|
||
jobs: | ||
preview: | ||
|
@@ -11,35 +13,30 @@ jobs: | |
uses: okteto/[email protected] | ||
with: | ||
token: ${{ secrets.OKTETO_GCP_TOKEN }} | ||
url: ${{secrets.OKTETO_GCP_URL}} | ||
url: ${{ secrets.OKTETO_GCP_URL }} | ||
|
||
- name: Deploy preview environment | ||
uses: okteto/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: pr-${{ github.event.number }} | ||
name: anonymize-pr-${{ github.event.number }} | ||
scope: global | ||
timeout: 15m | ||
variables: "DOPPLER_CONFIG=dev,DOPPLER_TOKEN=${{ secrets.DOPPLER_TOKEN }}" | ||
|
||
load-data: | ||
name: Load data from snapshot | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: load-data-from-snapshot | ||
run: | | ||
some bash command goes here | ||
echo "some bash command goes here" | ||
tests: | ||
name: Run integration tests | ||
name: Verify migration works | ||
runs-on: ubuntu-latest | ||
needs: preview | ||
steps: | ||
- id: run-alembic-tests | ||
name: Run Alembic migration tests | ||
env: | ||
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }} | ||
DOPPLER_PROJECT: my-big-proj | ||
DOPPLER_CONFIG: dev | ||
run: doppler run -- pytest test/alembic | ||
- id: run-migration | ||
name: Run Sequelize migration | ||
run: npx sequelize-cli db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM postgres:latest | ||
|
||
# SSH | ||
RUN apt-get update && apt-get install -y openssh-server | ||
RUN echo "root:Docker!" | chpasswd | ||
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
RUN mkdir /var/run/sshd | ||
|
||
EXPOSE 22 | ||
|
||
CMD service ssh start && docker-entrypoint.sh postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.