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

fix: cd script #155

Merged
merged 7 commits into from
Sep 16, 2023
Merged
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
23 changes: 13 additions & 10 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ jobs:

- name: 'Create env file'
run: |
touch .env
echo REACT_APP_ENCRYPTED_ENDPOINT=${{ vars.REACT_APP_ENCRYPTED_ENDPOINT}} >> .env
echo REACT_APP_QRCODE_VERIFY_ENDPOINT=${{ vars.REACT_APP_QRCODE_VERIFY_ENDPOINT }} >> .env
echo REACT_APP_SCHEMA_URL=${{ vars.REACT_APP_SCHEMA_URL }} >> .env
echo REACT_APP_REMOTE_AGENT_API_KEY=${{ vars.REACT_APP_REMOTE_AGENT_API_KEY }} >> .env
echo REACT_APP_DEFAULT_AGENT_ID=${{ vars.REACT_APP_DEFAULT_AGENT_ID }} >> .env
cat .env
touch packages/demo-explorer/.env
echo REACT_APP_WALLET_ENDPOINT=${{ vars.REACT_APP_WALLET_ENDPOINT }} >> packages/demo-explorer/.env
echo REACT_APP_ENCRYPTED_ENDPOINT=${{ vars.REACT_APP_ENCRYPTED_ENDPOINT}} >> packages/demo-explorer/.env
echo REACT_APP_QRCODE_VERIFY_ENDPOINT=${{ vars.REACT_APP_QRCODE_VERIFY_ENDPOINT }} >> packages/demo-explorer/.env
echo REACT_APP_SCHEMA_URL=${{ vars.REACT_APP_SCHEMA_URL }} >> packages/demo-explorer/.env
echo REACT_APP_REMOTE_AGENT_API_KEY=${{ vars.REACT_APP_REMOTE_AGENT_API_KEY }} >> packages/demo-explorer/.env
echo REACT_APP_DEFAULT_AGENT_ID=${{ vars.REACT_APP_DEFAULT_AGENT_ID }} >> packages/demo-explorer/.env
cat packages/demo-explorer/.env

- name: Build explorer
run: pnpm build:js
run: PUBLIC_URL=${{ env.environment == 'UN' && '/vckit/explorer/' || '/' }} pnpm build:js

- name: Archive artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -103,12 +104,14 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}

- name: Deploy to S3
run: aws s3 sync packages/demo-explorer/build/explorer/ s3://${{ vars.AWS_S3_BUCKET_NAME }}/vckit/explorer/ --delete
run: |
S3_PATH=${{ env.environment == 'UN' && '/vckit/explorer/' || '/'}}
aws s3 sync packages/demo-explorer/build/explorer/ s3://${{ vars.AWS_S3_BUCKET_NAME }}$S3_PATH --delete

- name: Invalidate CloudFront
run: |
DISTRIBUTION_ID=${{ vars.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
INVALIDATION_PATH="/vckit/explorer/*"
INVALIDATION_PATH=${{ env.environment == 'UN' && '/vckit/explorer/*' || '/*'}}

# Create a new CloudFront invalidation
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths $INVALIDATION_PATH
32 changes: 16 additions & 16 deletions packages/cli/default/default-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,22 @@ didManager:
- $ref: /dbConnection
defaultProvider: did:ethr:goerli
providers:
did:ethr:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: mainnet
rpcUrl: https://mainnet.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:ethr:goerli:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: goerli
rpcUrl: https://goerli.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
# did:ethr:
# $require: '@veramo/did-provider-ethr#EthrDIDProvider'
# $args:
# - defaultKms: local
# network: mainnet
# rpcUrl: https://mainnet.infura.io/v3/3586660d179141e3801c3895de1c2eba
# gas: 1000001
# ttl: 31104001
# did:ethr:goerli:
# $require: '@veramo/did-provider-ethr#EthrDIDProvider'
# $args:
# - defaultKms: local
# network: goerli
# rpcUrl: https://goerli.infura.io/v3/3586660d179141e3801c3895de1c2eba
# gas: 1000001
# ttl: 31104001
did:web:
$require: '@veramo/did-provider-web#WebDIDProvider'
$args:
Expand Down
32 changes: 17 additions & 15 deletions packages/demo-explorer/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,21 @@ const Layout = () => {
agent?.context?.name &&
GRAVATAR_URI + md5(agent?.context?.name) + '?s=200&d=retro'

const publicUrl = process.env.PUBLIC_URL;

const mainMenuItems: MenuDataItem = []

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: '/statistics',
path: publicUrl + '/statistics',
name: 'Statistics',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <EyeOutlined />,
})
}
if (availableMethods.includes('didManagerFind')) {
mainMenuItems.push({
path: '/managed-identifiers',
path: publicUrl + '/managed-identifiers',
name: 'Managed identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <UserOutlined />,
Expand All @@ -68,7 +70,7 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetVerifiableCredentials')) {
mainMenuItems.push({
path: '/credentials',
path: publicUrl + '/credentials',
name: 'Credentials',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SafetyOutlined />,
Expand All @@ -77,13 +79,13 @@ const Layout = () => {

if (availableMethods.includes('dataStoreORMGetMessages')) {
mainMenuItems.push({
path: '/activity',
path: publicUrl + '/activity',
name: 'Activity',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <BarsOutlined />,
})
mainMenuItems.push({
path: '/requests',
path: publicUrl + '/requests',
name: 'Requests',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <InteractionOutlined />,
Expand All @@ -95,15 +97,15 @@ const Layout = () => {
// availableMethods.includes('sendDIDCommMessage')
// ) {
// mainMenuItems.push({
// path: '/chats/threads',
// path: publicUrl + '/chats/threads',
// name: 'DID Chats',
// icon: <MessageOutlined />,
// })
// }

if (availableMethods.includes('dataStoreORMGetIdentifiers')) {
mainMenuItems.push({
path: '/known-identifiers',
path: publicUrl + '/known-identifiers',
name: 'Known identifiers',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <GlobalOutlined />,
Expand All @@ -112,7 +114,7 @@ const Layout = () => {

if (availableMethods.includes('verifyCredential')) {
mainMenuItems.push({
path: '/credential-verifier',
path: publicUrl + '/credential-verifier',
name: 'Credential verifier',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <FileProtectOutlined />,
Expand All @@ -123,37 +125,37 @@ const Layout = () => {

if (agent) {
mainMenuItems.push({
path: '/developer',
path: publicUrl + '/developer',
name: 'Credential issuer',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <CodeOutlined />,
routes: [
// {
// path: '/developer/data-generator',
// path: publicUrl + '/developer/data-generator',
// name: 'Data generator',
// },
{
path: '/developer/credential-from-schema',
path: publicUrl + '/developer/credential-from-schema',
name: 'Issue credential from example',
},
// {
// path: '/developer/issue-profile-credential',
// path: publicUrl + '/developer/issue-profile-credential',
// name: 'Issue profile credential',
// },
// {
// path: '/developer/issue-credential',
// path: publicUrl + '/developer/issue-credential',
// name: 'Issue credential',
// },
{
path: '/developer/create-presentation',
path: publicUrl + '/developer/create-presentation',
name: 'Create presentation',
},
],
})
}

mainMenuItems.push({
path: '/settings',
path: publicUrl + '/settings',
name: 'Settings',
// @ts-ignore FIXME: why is ts complaining about this?
icon: <SettingOutlined />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export class CreateDatabase1688974564002 implements MigrationInterface {
new Table({
name: migrationGetTableName(queryRunner, 'encrypted-data'),
columns: [
{ name: 'id', type: 'varchar', isPrimary: true },
{
name: 'id',
type: 'varchar',
isPrimary: true,
default: 'uuid_generate_v4()',
},
{ name: 'data', type: 'varchar', isNullable: false },
{ name: 'saveDate', type: dateTimeType },
{ name: 'updateDate', type: dateTimeType },
Expand Down