-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
37 lines (37 loc) · 1.17 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
version: 2
jobs:
build:
working_directory: ~/swift-ecs-ecr
docker:
- image: addli/swift:latest # Installed pip,aws-cli,jq and docker-ce to swiftdocker/swift.
branches:
only:
- master
steps:
- checkout
- setup_remote_docker
- run:
name: show environments
command: |
cat /etc/issue
swift --version
aws --version
docker version
- run:
name: Run build tests
command: |
swift package clean
swift build
- run:
name: Build image
command: |
docker build -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/swift-ecs-ecr:$CIRCLE_SHA1 .
- run:
name: Test container
command: |
docker run -d -p 8080:8080 --name swift-ecs-ecr $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/swift-ecs-ecr:$CIRCLE_SHA1;sleep 3
docker run --network container:swift-ecs-ecr appropriate/curl --retry 10 --retry-delay 5 http://localhost:8080/plaintext
- run:
name: Deploy image
command: |
sleep 3;./deploy.sh