我尝试将ember项目部署到AWS S3和cloudFront。在第一次部署时看起来都很好。我添加了一些提交,试图部署更改。部署触发成功但未对S3存储桶添加任何更改。当我尝试在本地构建项目时,我会看到我的资产提交。这有什么问题?这是我的package.json
{
"name": "camersion-frontend",
"version": "0.0.0",
"private": true,
"description": "Small description for camersion-frontend goes here",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js app config lib server tests",
"start": "ember serve",
"test": "ember test"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-cli": "~3.0.2",
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.6.0",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-aws-pack": "^1.0.1",
"ember-cli-deploy-display-revisions": "^1.0.0",
"ember-cli-deploy-revision-data": "^1.0.0",
"ember-cli-deploy-s3-index": "^1.0.1",
"ember-cli-eslint": "^4.2.1",
"ember-cli-form-data": "^1.1.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-moment-shim": "^3.7.1",
"ember-cli-notifications": "^4.2.1",
"ember-cli-qunit": "^4.1.1",
"ember-cli-sass": "^7.1.7",
"ember-cli-shims": "^1.2.0",
"ember-cli-spinjs": "^1.4.2",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.0.0",
"ember-concurrency": "^0.8.17",
"ember-cp-validations": "^4.0.0-beta.0",
"ember-data": "~3.0.0",
"ember-export-application-global": "^2.0.0",
"ember-inputmask": "^0.6.7",
"ember-load-initializers": "^1.0.0",
"ember-local-storage": "^1.4.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-moment": "^7.6.0",
"ember-radio-button": "^1.2.3",
"ember-resolver": "^4.0.0",
"ember-rl-dropdown": "^0.10.2",
"ember-route-action-helper": "^2.0.6",
"ember-route-task-helper": "^0.3.1",
"ember-simple-auth": "^1.6.0",
"ember-simple-auth-token": "^3.0.0",
"ember-source": "~3.0.0",
"ember-truth-helpers": "^2.0.0",
"ember-welcome-page": "^3.0.0",
"eslint-plugin-ember": "^5.0.0",
"loader.js": "^4.2.3",
"pagination-pager": "^3.2.2"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
},
"dependencies": {
"jquery-match-height": "^0.7.2",
"owasp-password-strength-test": "^1.3.0"
}
}
和config deploy
module.exports = function (deployTarget) {
let ENV = {
build: {
environment: deployTarget
},
'revision-data': {
type: 'git-commit',
},
's3-index': {
accessKeyId: process.env.AWS_KEY,
secretAccessKey: process.env.AWS_SECRET,
bucket: process.env.AWS_BUCKET,
region: process.env.AWS_REGION,
allowOverwrite: true,
},
s3: {
accessKeyId: process.env.AWS_KEY,
secretAccessKey: process.env.AWS_SECRET,
bucket: process.env.AWS_BUCKET,
region: process.env.AWS_REGION,
filePattern: '*',
},
cloudfront: {
distribution: process.env.DISTRIBUTION,
},
}
if (deployTarget === 'development') {
ENV.build.environment = 'development'
}
if (deployTarget === 'staging') {
ENV.build.environment = 'production'
}
if (deployTarget === 'production') {
ENV.build.environment = 'production'
}
return ENV
}
答案 0 :(得分:0)
您的新资产可能已经编译甚至发送到S3,它现在可能是激活您最新部署的问题。
Ember-cli-deploy提供了两种激活部署的方法(seen here)。
ember deploy --activate
"触发activate * hooks传递刚刚上传的修订版。"。
ember deploy:activate
"运行一个带有activate *钩子的管道,某些插件实现这个钩子,使得特定版本作为后端服务的活动版本。
采用强制--revision = revisionKey参数。
离。
ember deploy:activate production --revision=43cc587
在运行任一命令之前,请仔细检查您的更改实际上是使用ember deploy:list
命令部署的。