* Runs Serverless Engine Deploy * @param {Object} options - The options object * @param {boolean} [options.force=false] - Force deployment even if no changes detected * @returns {Promise } - Returns the updated state
({ force = false } = {})
| 273 | * @returns {Promise<Object>} - Returns the updated state |
| 274 | */ |
| 275 | async deploy({ force = false } = {}) { |
| 276 | // Load state |
| 277 | await this.#state.load() |
| 278 | |
| 279 | // Run deploy and get the updated state |
| 280 | await this.#deploymentTypeInstance.deploy({ force }) |
| 281 | |
| 282 | // On successful deployment.. |
| 283 | this.#state.state.timeLastDeployed = new Date().toISOString() |
| 284 | this.#state.state.isDeployed = true |
| 285 | // ONLY save new project config in state if deployment was successful |
| 286 | this.#state.state.config = this.#projectConfig |
| 287 | |
| 288 | // Save the state |
| 289 | await this.#state.save() |
| 290 | |
| 291 | return this.#state.state |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * Runs Serverless Containers Dev Mode |