Anatol
10/01/2021, 8:41 PMsls package), and I've used buildspec instead of post deploy phase like below:
after_deploy:
- if [ $SEED_SERVICE_NAME = "cognito" ]; then cd /tmp/seed/source/services/appsync && yarn && sls deploy; fiFrank
Anatol
10/01/2021, 8:47 PMFrank
Anatol
10/01/2021, 8:48 PMFrank
devDependencies, they should get installed with npm/yarn install.Anatol
10/01/2021, 8:49 PMpackage.json again and again..Anatol
10/01/2021, 8:49 PMAnatol
10/01/2021, 8:49 PMFrank
Anatol
10/01/2021, 8:50 PMAnatol
10/01/2021, 8:50 PMAnatol
10/01/2021, 8:51 PMpackage.json again and again... no way to share one build server across multiple services? if we can do it, it will optimize the whole build time a lot..Anatol
10/01/2021, 8:53 PMFrank
Frank
node_modules automatically, and will restore the cache.Anatol
10/01/2021, 8:55 PMFrank
INFO: Restoring dependency cache... line, you’ll see the cache wasn’t found.Frank
Anatol
10/01/2021, 8:58 PMAnatol
10/01/2021, 8:58 PMFrank
Frank
Frank
package.json and if you don’t force deploy, yarn should finish in a few seconds with cache present.Anatol
10/01/2021, 9:02 PMAnatol
10/01/2021, 9:03 PMFrank
Anatol
10/01/2021, 9:04 PMpackage.json and install all dependencies and devDependencies in force for every service?Frank
Frank
Anatol
10/01/2021, 9:05 PMFrank
Frank
Anatol
10/01/2021, 9:06 PMAnatol
10/01/2021, 9:07 PMcheck_code_change: true in seed.yml, I can't integrate the deployment of implicit service in another service as I did currentlyAnatol
10/01/2021, 9:07 PMFrank
Anatol
10/01/2021, 9:07 PMFrank
after_deploy approach.Anatol
10/01/2021, 9:08 PMFrank
Anatol
10/01/2021, 9:08 PMAnatol
10/01/2021, 9:09 PMFrank
/
services/
appsync/
serverless.yml <- fake service
real/
serverless.yml <- real serviceAnatol
10/01/2021, 9:10 PMFrank
after_deploy phase, cd services/appsync/real && sls deployFrank
Anatol
10/01/2021, 9:10 PMAnatol
10/01/2021, 9:12 PMAnatol
10/01/2021, 9:12 PMFrank
Anatol
10/01/2021, 9:29 PMAnatol
10/01/2021, 9:29 PMAnatol
10/01/2021, 9:30 PMAnatol
10/01/2021, 9:30 PMAnatol
10/01/2021, 9:30 PMFrank
services/appsync?Anatol
10/01/2021, 9:32 PMAnatol
10/01/2021, 9:32 PMFrank
services/appsync/serverless.ymlAnatol
10/01/2021, 9:34 PMAnatol
10/01/2021, 9:34 PMservices/appsync/serverless.ymlFrank
Anatol
10/01/2021, 9:34 PMAnatol
10/01/2021, 9:35 PMserverless.yml ?Anatol
10/01/2021, 9:35 PMFrank
serverless.yml with empty functions and resourcesAnatol
10/01/2021, 9:35 PMAnatol
10/01/2021, 9:35 PMAnatol
10/01/2021, 9:36 PMservice: appsync
frameworkVersion: "2"
disabledDeprecations:
- CLI_OPTIONS_SCHEMA
- NEW_VARIABLES_RESOLVER
provider:
name: aws
profile: havona
runtime: nodejs14.x
region: ap-southeast-1
stage: devAnatol
10/01/2021, 9:36 PMsls.ymlFrank
service: appsync-fake makes more sense?Frank
service: appsyncAnatol
10/01/2021, 9:36 PMAnatol
10/01/2021, 9:37 PMAnatol
10/01/2021, 9:37 PMAnatol
10/01/2021, 9:38 PMAnatol
10/01/2021, 9:38 PMcheck_code_change: trueAnatol
10/01/2021, 9:47 PMAnatol
10/01/2021, 9:48 PMAnatol
10/01/2021, 9:48 PMAnatol
10/01/2021, 10:04 PMAnatol
10/01/2021, 10:04 PMAnatol
10/01/2021, 10:05 PMserverless.yml is using profile: havonaAnatol
10/01/2021, 10:05 PMFrank
Anatol
10/01/2021, 10:15 PMAnatol
10/01/2021, 10:15 PMAnatol
10/01/2021, 10:15 PMAnatol
10/01/2021, 10:15 PMAnatol
10/04/2021, 7:16 AMAnatol
10/04/2021, 3:43 PMAnatol
10/04/2021, 9:07 PMAnatol
10/04/2021, 9:08 PMAnatol
10/04/2021, 9:08 PMFrank
Anatol
10/04/2021, 9:10 PMAnatol
10/04/2021, 9:10 PMFrank
Frank
if [ $SEED_SERVICE_NAME = "appsync" ]; then cd /tmp/seed/source/services/appsync && yarn && sls deploy; fi
try:
if [ $SEED_SERVICE_NAME = "appsync" ]; then cd /tmp/seed/source/services/appsync && sed -i '' '/profile: default/d' serverless.yml && yarn && sls deploy; fiFrank
default to the profile in the serverless.ymlFrank
serverless.yml before deploying. And your IAM credentials will be used.Frank
Anatol
10/05/2021, 10:30 AMAnatol
10/05/2021, 4:13 PMAnatol
10/05/2021, 4:13 PMcheck_code_change: true
after_deploy:
- "if [ $SEED_SERVICE_NAME = 'appsync' ]; then cd /tmp/seed/source/services/appsync && sed -i '' '/profile: havona/d' serverless.yml && yarn && sls deploy; fi"Anatol
10/05/2021, 4:13 PMFrank
Anatol
10/05/2021, 4:14 PMAnatol
10/05/2021, 4:17 PMserverless.yml in services/appsync directoryAnatol
10/05/2021, 4:18 PMserverless.ymlFrank
sed -i '' '/profile: havona/d' serverless.yml
Can you give this a try:
sed -i 's/profile: havona//g' serverless.yml
The sed command works differently on different OS. The latter should work on Ubuntu (build server OS)Anatol
10/05/2021, 4:19 PMAnatol
10/05/2021, 4:19 PM's/profile: havona//g'Anatol
10/05/2021, 4:19 PMFrank
-i means replace in line
s/profile: havona//g means search and replace with empty stringAnatol
10/05/2021, 4:19 PMgFrank
profile: havona with empty string (nothing within the slashs)Anatol
10/05/2021, 4:20 PMAnatol
10/05/2021, 4:21 PMAnatol
10/05/2021, 4:25 PMAnatol
10/05/2021, 4:25 PMFrank