Skip to content

Commit

Permalink
fix: cd script (#155)
Browse files Browse the repository at this point in the history
<!--
  For Work In Progress Pull Requests, please use the Draft PR feature,
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for
further details.
  
  For a timely review/response, please avoid force-pushing additional
  commits if your PR already received reviews or comments.
  
Before submitting a Pull Request, please ensure you've done the
following:
- 📖 Read the [Contributing
Guide](https://github.com/uncefact/project-vckit/blob/main/CONTRIBUTING.md).
- 📖 Read the [Code of
Conduct](https://github.com/uncefact/project-vckit/blob/main/CODE_OF_CONDUCT.md).
  - 👷‍♀️ Create small PRs. In most cases, this will be possible.
  - ✅ Provide tests for your changes.
- 📝 Use descriptive commit messages following [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/).
- 📗 Update any related documentation and include any relevant
screenshots.
-->

## What type of PR is this? (check all applicable)

- [ ] 🍕 Feature
- [x] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🎨 Style
- [ ] 🧑‍💻 Code Refactor
- [ ] 🔥 Performance Improvements
- [ ] ✅ Test
- [ ] 🤖 Build
- [ ] 🔁 CI
- [ ] 📦 Chore (Release)
- [ ] ⏩ Revert

## Description

<!-- 
Please do not leave this blank 
This PR [adds/removes/fixes/replaces] the [feature/bug/etc]. 
-->
This PR fixes the wrong configuration for the CD script
## Related Tickets & Documents
<!-- 
Please use this format link issue numbers: Fixes #123

https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Mobile & Desktop Screenshots/Recordings

<!-- Visual changes require screenshots -->


## Added tests?

- [ ] 👍 yes
- [ ] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help

## Added to documentation?

- [ ] 📜 README.md
- [ ] 📓 [vc-kit doc site](https://uncefact.github.io/vckit/)
- [ ] 📕 storybook
- [x] 🙅 no documentation needed

## [optional] Are there any post-deployment tasks we need to perform?


<!-- note: PRs with deleted sections will be marked invalid -->

---------

Signed-off-by: Nam Hoang <[email protected]>
Co-authored-by: Kseniya Shychko <[email protected]>
  • Loading branch information
namhoang1604 and kshychko committed Sep 16, 2023
1 parent cf8c801 commit 4345d98
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 42 deletions.
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

0 comments on commit 4345d98

Please sign in to comment.