downloadWebisteManifest()

in source/helper/lib/website-helper.js [62:102]


        downloadWebisteManifest(sourceS3Bucket, sourceManifest, _downloadLocation, function(err, data) {
            if (err) {
                console.log(err);
                return cb(err, null);
            }

            fs.readFile(_downloadLocation, 'utf8', function(err, data) {
                if (err) {
                    console.log(err);
                    return cb(err, null);
                }

                console.log(data);
                let _manifest = validateJSON(data);

                if (!_manifest) {
                    return cb('Unable to validate downloaded manifest file JSON', null);
                } else {
                    uploadFile(_manifest.files, 0, destS3Bucket, [sourceS3Bucket, sourceS3prefix]
                        .join('/'),
                        function(err, result) {
                            if (err) {
                                return cb(err, null);
                            }

                            console.log(result);

                            createAppVariables(userPoolId, userPoolClientId, identityPoolId, region, destS3Bucket, uuid, dashboard_usage, metrics_table, ip_table,
                                function(err, createResult) {
                                    if (err) {
                                        return cb(err, null);
                                    }

                                    return cb(null, result);
                                });
                        });
                }

            });

        });