Skip to content
Draft
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
42 changes: 0 additions & 42 deletions lib/getS3Creds.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/aio-lib-web",
"version": "7.1.0",
"version": "7.1.1",
"description": "Utility tooling library to build and deploy Adobe I/O Project Firefly app static sites to CDN",
"main": "index.js",
"directories": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"@adobe/aio-lib-core-config": "^5",
"@adobe/aio-lib-core-logging": "^3",
"@adobe/aio-lib-core-tvm": "^4",
"@aws-sdk/client-s3": "^3.624.0",
"@adobe/aio-lib-env": "^3.0.1",
"@smithy/node-http-handler": "^4.0.2",
"core-js": "^3.25.1",
"fs-extra": "^11",
Expand Down
17 changes: 6 additions & 11 deletions src/deploy-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ governing permissions and limitations under the License.
*/

const RemoteStorage = require('../lib/remote-storage')
const getS3Credentials = require('../lib/getS3Creds')

const fs = require('fs-extra')
const path = require('path')
Expand All @@ -21,6 +20,11 @@ const deployWeb = async (config, log) => {
throw new Error('cannot deploy web, app has no frontend or config is invalid')
}

const bearerToken = await config?.ow?.auth_handler?.getAuthHeader()
if (!bearerToken) {
throw new Error('cannot deploy web, Authorization is required')
}

/// build files
const dist = config.web.distProd
if (!fs.existsSync(dist) ||
Expand All @@ -30,17 +34,8 @@ const deployWeb = async (config, log) => {
throw new Error(`missing files in ${dist}, maybe you forgot to build your UI ?`)
}

const creds = await getS3Credentials(config)
const remoteStorage = new RemoteStorage()

const remoteStorage = new RemoteStorage(creds)
const exists = await remoteStorage.folderExists(config.s3.folder + '/')

if (exists) {
if (log) {
log('warning: an existing deployment will be overwritten')
}
await remoteStorage.emptyFolder(config.s3.folder + '/')
}
const _log = log ? (f) => log(`deploying ${path.relative(dist, f)}`) : null
await remoteStorage.uploadDir(dist, config.s3.folder, config, _log)

Expand Down
73 changes: 0 additions & 73 deletions test/lib/getS3Creds.test.js

This file was deleted.

Loading