Skip to content

Commit ddff3fa

Browse files
committed
Add testing for ubuntu18.04
1 parent dfa03da commit ddff3fa

File tree

4 files changed

+56
-5
lines changed

4 files changed

+56
-5
lines changed

.circleci/config.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@ jobs:
55
steps:
66
- checkout
77
- run: docker-compose up shellcheck
8-
bats:
8+
9+
bats_ubuntu1604:
910
# We need to run Docker Compose with privileged settings, which isn't supported by CircleCI's Docker executor, so
1011
# we have to use the machine executor instead.
1112
machine: true
1213
steps:
1314
- checkout
14-
- run: docker-compose up bats
15+
- run: docker-compose up bats_ubuntu1604
16+
17+
bats_ubuntu1804:
18+
# We need to run Docker Compose with privileged settings, which isn't supported by CircleCI's Docker executor, so
19+
# we have to use the machine executor instead.
20+
machine: true
21+
steps:
22+
- checkout
23+
- run: docker-compose up bats_ubuntu1804
24+
1525
workflows:
1626
version: 2
1727
checks:
1828
jobs:
1929
- shellcheck
20-
- bats
30+
- bats_ubuntu1604
31+
- bats_ubuntu1804

Dockerfile.ubuntu18.04.bats

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:18.04
2+
MAINTAINER Gruntwork <info@gruntwork.io>
3+
4+
# Install basic dependencies
5+
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
6+
apt-get install -y vim python-pip jq sudo curl
7+
8+
# Install Bats
9+
RUN apt-get install -y software-properties-common && \
10+
add-apt-repository ppa:duggan/bats && \
11+
DEBIAN_FRONTEND=noninteractive apt-get update && \
12+
apt-get install -y bats
13+
14+
# Install AWS CLI
15+
RUN pip install awscli --upgrade --user
16+
17+
# Install moto: https://github.com/spulec/moto
18+
RUN pip install flask moto moto[server]
19+
20+
# Install tools we'll need to create a mock EC2 metadata server
21+
RUN apt-get install -y net-tools iptables
22+
23+
# Copy mock AWS CLI into the PATH
24+
COPY ./.circleci/aws-local.sh /usr/local/bin/aws

docker-compose.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,26 @@ services:
88
- ./:/usr/local/src/bash-commons
99
working_dir: /usr/local/src/bash-commons/.circleci
1010
command: ./shellcheck.sh
11-
bats:
11+
bats_ubuntu1604:
1212
build:
1313
context: ./
14-
dockerfile: Dockerfile.bats
14+
dockerfile: Dockerfile.ubuntu16.04.bats
15+
volumes:
16+
# Mount all the files so you have "hot reload" of all changes from the host
17+
- ./:/usr/local/src/bash-commons
18+
working_dir: /usr/local/src/bash-commons
19+
command: bats test
20+
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP
21+
privileged: true
22+
ports:
23+
# For moto
24+
- "5000:5000"
25+
# For ec2-metadata-mock
26+
- "8111:8111"
27+
bats_ubuntu1804:
28+
build:
29+
context: ./
30+
dockerfile: Dockerfile.ubuntu18.04.bats
1531
volumes:
1632
# Mount all the files so you have "hot reload" of all changes from the host
1733
- ./:/usr/local/src/bash-commons

0 commit comments

Comments
 (0)