Skip to content

Commit 859686e

Browse files
authored
Merge pull request #288 from silinternational/develop
Release 3.10.16 - allow underscores in tag names
2 parents f8fe971 + 907dcb7 commit 859686e

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ Usage
2929
-n | --service-name Name of service to deploy
3030
-i | --image Name of Docker image to run, ex: repo/image:latest
3131
Format: [domain][:port][/repo][/][image][:tag]
32-
Examples: mariadb, mariadb:latest, silintl/mariadb,
33-
silintl/mariadb:latest, private.registry.com:8000/repo/image:tag
32+
Examples: mariadb, mariadb:latest, private.registry.com:8000/repo/image:tag
3433

3534
Optional arguments:
3635
-a | --aws-assume-role ARN for AWS Role to assume for ecs-deploy operations.
@@ -261,4 +260,4 @@ deploy_to_ecs:
261260
service_name: 'aws-service-name'
262261
timeout_cmd: '--timeout'
263262
timeout: '360'
264-
```
263+
```

docker-compose.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
ecsdeploy:
2-
build: .
3-
env_file:
4-
- local.env
5-
volumes:
6-
- ./ecs-deploy:/ecs-deploy
1+
services:
2+
ecsdeploy:
3+
build: .
4+
env_file:
5+
- local.env
6+
volumes:
7+
- ./ecs-deploy:/ecs-deploy
78

8-
test:
9-
build: .
10-
env_file:
11-
- local.env
12-
entrypoint: ["bash"]
13-
command: ["/run-tests.sh"]
14-
volumes:
15-
- ./ecs-deploy:/ecs-deploy
16-
- ./run-tests.sh:/run-tests.sh
17-
- ./test.bats:/test.bats
9+
test:
10+
build: .
11+
env_file:
12+
- local.env
13+
entrypoint: ["bash"]
14+
command: ["/run-tests.sh"]
15+
volumes:
16+
- ./ecs-deploy:/ecs-deploy
17+
- ./run-tests.sh:/run-tests.sh
18+
- ./test.bats:/test.bats

ecs-deploy

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Setup default values for variables
4-
VERSION="3.10.15"
4+
VERSION="3.10.16"
55
CLUSTER=false
66
SERVICE=false
77
TASK_DEFINITION=false
@@ -47,8 +47,7 @@ Required arguments:
4747
-c | --cluster Name of ECS cluster
4848
-i | --image Name of Docker image to run, ex: repo/image:latest
4949
Format: [domain][:port][/repo][/][image][:tag]
50-
Examples: mariadb, mariadb:latest, silintl/mariadb,
51-
silintl/mariadb:latest, private.registry.com:8000/repo/image:tag
50+
Examples: mariadb, mariadb:latest, private.registry.com:8000/repo/image:tag
5251
--aws-instance-profile Use the IAM role associated with this instance
5352
5453
Optional arguments:
@@ -252,7 +251,7 @@ function parseImageName() {
252251
fi
253252
else
254253
# check if using root level repo with format like mariadb or mariadb:latest
255-
rootRepoRegex="^([a-zA-Z0-9\-]+):?([a-zA-Z0-9\.\-]+)?$"
254+
rootRepoRegex="^([a-zA-Z0-9\-]+):?([a-zA-Z0-9\.\-_]+)?$"
256255
if [[ $IMAGE =~ $rootRepoRegex ]]; then
257256
img=${BASH_REMATCH[1]}
258257
if [[ "x$img" == "x" ]]; then

test.bats

+16
Original file line numberDiff line numberDiff line change
@@ -670,3 +670,19 @@ EOF
670670
[ ! -z $status ]
671671
[ "$(echo "$output" | jq .)" == "$(echo "$expected" | jq .)" ]
672672
}
673+
674+
@test "test parseImageName using image starting with underscore" {
675+
IMAGE="_something:tag123"
676+
TAGVAR=false
677+
run parseImageName
678+
[ $status -eq 13 ]
679+
}
680+
681+
@test "test parseImageName using image containing an underscore in tag name" {
682+
IMAGE="something:tag_123"
683+
TAGVAR=false
684+
run parseImageName
685+
[ ! -z $status ]
686+
[ "$output" == "something:tag_123" ]
687+
echo "output = $output" 1>&2
688+
}

0 commit comments

Comments
 (0)