hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

unary operator error #258

Closed MikeTheCanuck closed 5 years ago

MikeTheCanuck commented 5 years ago

Twice now I've spotted this error when Travis is attempting to use ecs-deploy.sh on one of our repos (I've snipped out ... duplicate-ish lines for brevity):

Deploying application
Getting the ECR login...
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
Tagging with release-v0.1.3
The push refers to a repository [845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-transportation]
a05ce82471d6: Preparing
...
31b0e148310d: Preparing
ca4adf32623e: Waiting
...
0bd73e6e9f78: Waiting
a05ce82471d6: Pushed
...
8c487c756d71: Pushed
release-v0.1.3: digest: sha256:89c650ff8fb0ab24c6fe4eb23027d2f5db0f2f0165d16675c10f509fa7f61167 size: 6181
Tagging with latest
]The push refers to a repository [845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-transportation]
a05ce82471d6: Preparing
...
31b0e148310d: Preparing
a0f00b01637b: Waiting
...
29aea800d863: Waiting
b24ff3786412: Layer already exists
...
31b0e148310d: Layer already exists
latest: digest: sha256:89c650ff8fb0ab24c6fe4eb23027d2f5db0f2f0165d16675c10f509fa7f61167 size: 6181
bin/ecs-deploy.sh: line 144: [: ==: unary operator expected
bin/ecs-deploy.sh: line 148: [: !=: unary operator expected
bin/ecs-deploy.sh: line 152: [: !=: unary operator expected
Using image name: 845828040396.dkr.ecr.us-west-2.amazonaws.com/staging/2019-transportation:latest
bin/ecs-deploy.sh: line 275: [: !=: unary operator expected
bin/ecs-deploy.sh: line 293: TASK_DEFINITION_ARN: unbound variable
Script failed with status 1
failed to deploy
MikeTheCanuck commented 5 years ago

The resolution to this issue is to define the following environment variables in the Travis repo's settings: ECS_SERVICE_NAME, ECS_CLUSTER