Skip to content

Commit

Permalink
Merge pull request #77 from wri/create_edit_teams
Browse files Browse the repository at this point in the history
Create edit teams
  • Loading branch information
steveoni authored Nov 8, 2023
2 parents 19d4f6a + 5570884 commit 9697477
Show file tree
Hide file tree
Showing 63 changed files with 5,939 additions and 461 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ jobs:
- name: Set up Docker Containers
env:
CKAN_IMAGE: '${{ steps.login-ecr.outputs.registry }}/${{ secrets.ECR_CKAN_REPO }}:${{ github.sha }}'
MINIO_ROOT_USER: 'minioadmin'
MINIO_ROOT_PASSWORD: 'minioadmin'
run: docker compose -f docker-compose.test.yml --env-file .env.example up --build -d
working-directory: ./ckan-backend-dev
- name: Print Container names
run: docker ps -a
- name: Print logs
run: docker logs wri-frontend
- name: Cypress Install and CKAN setup
uses: cypress-io/github-action@v6
with:
Expand All @@ -70,13 +76,26 @@ jobs:
node-version: 18
runTests: false
working-directory: ./integration-tests
- name: Cypress Install and Frontend setup
uses: cypress-io/github-action@v6
with:
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
node-version: 18
runTests: false
working-directory: ./e2e-tests
- name: Create sysadmin API for Authorization
run: bash ./ckan-backend-dev/ckan/scripts/cypress_setup.sh
- name: Run Integration tests 🧪
uses: cypress-io/github-action@v6
with:
command: node test.js
working-directory: ./integration-tests
- name: Run frontend tests 🧪
uses: cypress-io/github-action@v6
with:
command: npm run test
working-directory: ./e2e-tests
- name: Copy run_unit_tests.sh
run: docker cp ./ckan/scripts/run_unit_tests.sh ckan-wri:/srv/app/run_unit_tests.sh
working-directory: ./ckan-backend-dev
Expand Down
2 changes: 1 addition & 1 deletion ckan-backend-dev/ckan/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ RUN ckan config-tool ${CKAN_INI} "api_token.jwt.algorithm = RS256" && \
ckan config-tool ${CKAN_INI} "api_token.jwt.encode.secret = file:${APP_DIR}/jwtRS256.key" && \
ckan config-tool ${CKAN_INI} "api_token.jwt.decode.secret = file:${APP_DIR}/jwtRS256.key.pub"

CMD ["sh", "-c", "${APP_DIR}/start_ckan_development.sh"]
CMD ["sh", "-c", "${APP_DIR}/start_ckan_development.sh"]
1 change: 1 addition & 0 deletions ckan-backend-dev/ckan/scripts/cypress_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ cp ../../../integration-tests/cypress.json.example ../../../integration-tests/cy

# Replace the token placeholder with the generated token
sed -i "s/CKAN_API_TOKEN/$token/g" ../../../integration-tests/cypress.json
sed -i "s/CKAN_API_TOKEN/$token/g" ../../../e2e-tests/cypress.config.js
27 changes: 27 additions & 0 deletions ckan-backend-dev/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@ services:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
image: ${CKAN_IMAGE}

frontend:
container_name: wri-frontend
build:
context: ../deployment/frontend/
args:
- NEXTAUTH_SECRET=secret
- NEXTAUTH_URL=http://localhost:3000
- CKAN_URL=http://ckan-dev:5000
- S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- S3_SECRET_KEY_ID=${MINIO_ROOT_PASSWORD}
- S3_BUCKET_NAME=ckan
- S3_BUCKET_REGION=us-east-1
environment:
- NEXTAUTH_SECRET=secret
- NEXTAUTH_URL=http://localhost:3000
- CKAN_URL=http://ckan-dev:5000
- S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- S3_SECRET_KEY_ID=${MINIO_ROOT_PASSWORD}
- S3_BUCKET_NAME=ckan
- S3_BUCKET_REGION=us-east-1
ports:
- "0.0.0.0:3000:3000"
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:3000"]

datapusher:
container_name: ${DATAPUSHER_CONTAINER_NAME}
image: ckan/ckan-base-datapusher:${DATAPUSHER_VERSION}
Expand All @@ -45,6 +70,8 @@ services:
container_name: ${POSTGRESQL_CONTAINER_NAME}
build:
context: postgresql/
ports:
- "5432:5432"
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
Expand Down
25 changes: 25 additions & 0 deletions ckan-backend-dev/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@ services:
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"]

frontend:
container_name: wri-frontend
build:
context: ../deployment/frontend/
args:
- NEXTAUTH_SECRET=secret
- NEXTAUTH_URL=http://localhost:3000
- CKAN_URL=http://ckan-dev:5000
- S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- S3_SECRET_KEY_ID=${MINIO_ROOT_PASSWORD}
- S3_BUCKET_NAME=ckan
- S3_BUCKET_REGION=us-east-1
environment:
- NEXTAUTH_SECRET=secret
- NEXTAUTH_URL=http://localhost:3000
- CKAN_URL=http://ckan-dev:5000
- S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}
- S3_SECRET_KEY_ID=${MINIO_ROOT_PASSWORD}
- S3_BUCKET_NAME=ckan
- S3_BUCKET_REGION=us-east-1
ports:
- "0.0.0.0:3000:3000"
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:3000"]

db:
container_name: ${POSTGRESQL_CONTAINER_NAME}
build:
Expand Down
12 changes: 9 additions & 3 deletions deployment/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
#NEXTAUTH_SECRET="secret"
#NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="secret"
NEXTAUTH_URL="http://localhost:3000"

# Next Auth CKAN Login Provider
#CKAN_URL="https://demo.dev.datopian.com"
CKAN_URL="https://demo.dev.datopian.com"
#
# S3 Storage
S3_ACCESS_KEY_ID="minioadmin"
S3_SECRET_KEY_ID="minioadmin"
S3_BUCKET_NAME="ckan"
S3_BUCKET_REGION="us-east-1"
Loading

0 comments on commit 9697477

Please sign in to comment.