Skip to content

Commit

Permalink
Merge pull request gruntwork-io#17 from gruntwork-io/yori-ubuntu18
Browse files Browse the repository at this point in the history
Add testing for ubuntu18.04
  • Loading branch information
yorinasub17 authored Oct 7, 2019
2 parents dfa03da + d28ad95 commit e1be417
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
17 changes: 14 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ jobs:
steps:
- checkout
- run: docker-compose up shellcheck
bats:

bats_ubuntu1604:
# We need to run Docker Compose with privileged settings, which isn't supported by CircleCI's Docker executor, so
# we have to use the machine executor instead.
machine: true
steps:
- checkout
- run: docker-compose up bats
- run: docker-compose up bats_ubuntu1604

bats_ubuntu1804:
# We need to run Docker Compose with privileged settings, which isn't supported by CircleCI's Docker executor, so
# we have to use the machine executor instead.
machine: true
steps:
- checkout
- run: docker-compose up bats_ubuntu1804

workflows:
version: 2
checks:
jobs:
- shellcheck
- bats
- bats_ubuntu1604
- bats_ubuntu1804
File renamed without changes.
24 changes: 24 additions & 0 deletions Dockerfile.ubuntu18.04.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:18.04
MAINTAINER Gruntwork <[email protected]>

# Install basic dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y vim python-pip jq sudo curl

# Install Bats
RUN apt-get install -y software-properties-common && \
add-apt-repository ppa:duggan/bats && \
DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y bats

# Install AWS CLI
RUN pip install awscli --upgrade --user

# Install moto: https://github.com/spulec/moto
RUN pip install flask moto moto[server]

# Install tools we'll need to create a mock EC2 metadata server
RUN apt-get install -y net-tools iptables

# Copy mock AWS CLI into the PATH
COPY ./.circleci/aws-local.sh /usr/local/bin/aws
20 changes: 13 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,25 @@ services:
- ./:/usr/local/src/bash-commons
working_dir: /usr/local/src/bash-commons/.circleci
command: ./shellcheck.sh
bats:
bats_ubuntu1604:
build:
context: ./
dockerfile: Dockerfile.bats
dockerfile: Dockerfile.ubuntu16.04.bats
volumes:
# Mount all the files so you have "hot reload" of all changes from the host
- ./:/usr/local/src/bash-commons
working_dir: /usr/local/src/bash-commons
command: bats test
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP
privileged: true
bats_ubuntu1804:
build:
context: ./
dockerfile: Dockerfile.ubuntu18.04.bats
volumes:
# Mount all the files so you have "hot reload" of all changes from the host
- ./:/usr/local/src/bash-commons
working_dir: /usr/local/src/bash-commons
command: bats test
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP
privileged: true
ports:
# For moto
- "5000:5000"
# For ec2-metadata-mock
- "8111:8111"

0 comments on commit e1be417

Please sign in to comment.