Skip to content

Commit

Permalink
Merge pull request #288 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 3.10.16 - allow underscores in tag names
  • Loading branch information
briskt authored Jan 4, 2024
2 parents f8fe971 + 907dcb7 commit 859686e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Usage
-n | --service-name Name of service to deploy
-i | --image Name of Docker image to run, ex: repo/image:latest
Format: [domain][:port][/repo][/][image][:tag]
Examples: mariadb, mariadb:latest, silintl/mariadb,
silintl/mariadb:latest, private.registry.com:8000/repo/image:tag
Examples: mariadb, mariadb:latest, private.registry.com:8000/repo/image:tag

Optional arguments:
-a | --aws-assume-role ARN for AWS Role to assume for ecs-deploy operations.
Expand Down Expand Up @@ -261,4 +260,4 @@ deploy_to_ecs:
service_name: 'aws-service-name'
timeout_cmd: '--timeout'
timeout: '360'
```
```
33 changes: 17 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
ecsdeploy:
build: .
env_file:
- local.env
volumes:
- ./ecs-deploy:/ecs-deploy
services:
ecsdeploy:
build: .
env_file:
- local.env
volumes:
- ./ecs-deploy:/ecs-deploy

test:
build: .
env_file:
- local.env
entrypoint: ["bash"]
command: ["/run-tests.sh"]
volumes:
- ./ecs-deploy:/ecs-deploy
- ./run-tests.sh:/run-tests.sh
- ./test.bats:/test.bats
test:
build: .
env_file:
- local.env
entrypoint: ["bash"]
command: ["/run-tests.sh"]
volumes:
- ./ecs-deploy:/ecs-deploy
- ./run-tests.sh:/run-tests.sh
- ./test.bats:/test.bats
7 changes: 3 additions & 4 deletions ecs-deploy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Setup default values for variables
VERSION="3.10.15"
VERSION="3.10.16"
CLUSTER=false
SERVICE=false
TASK_DEFINITION=false
Expand Down Expand Up @@ -47,8 +47,7 @@ Required arguments:
-c | --cluster Name of ECS cluster
-i | --image Name of Docker image to run, ex: repo/image:latest
Format: [domain][:port][/repo][/][image][:tag]
Examples: mariadb, mariadb:latest, silintl/mariadb,
silintl/mariadb:latest, private.registry.com:8000/repo/image:tag
Examples: mariadb, mariadb:latest, private.registry.com:8000/repo/image:tag
--aws-instance-profile Use the IAM role associated with this instance
Optional arguments:
Expand Down Expand Up @@ -252,7 +251,7 @@ function parseImageName() {
fi
else
# check if using root level repo with format like mariadb or mariadb:latest
rootRepoRegex="^([a-zA-Z0-9\-]+):?([a-zA-Z0-9\.\-]+)?$"
rootRepoRegex="^([a-zA-Z0-9\-]+):?([a-zA-Z0-9\.\-_]+)?$"
if [[ $IMAGE =~ $rootRepoRegex ]]; then
img=${BASH_REMATCH[1]}
if [[ "x$img" == "x" ]]; then
Expand Down
16 changes: 16 additions & 0 deletions test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -670,3 +670,19 @@ EOF
[ ! -z $status ]
[ "$(echo "$output" | jq .)" == "$(echo "$expected" | jq .)" ]
}

@test "test parseImageName using image starting with underscore" {
IMAGE="_something:tag123"
TAGVAR=false
run parseImageName
[ $status -eq 13 ]
}

@test "test parseImageName using image containing an underscore in tag name" {
IMAGE="something:tag_123"
TAGVAR=false
run parseImageName
[ ! -z $status ]
[ "$output" == "something:tag_123" ]
echo "output = $output" 1>&2
}

0 comments on commit 859686e

Please sign in to comment.