Skip to content

Commit

Permalink
ubuntu version updates (#66)
Browse files Browse the repository at this point in the history
- Remove ubuntu 16.04/18.04
- Add support for ubuntu 22.04
- Add test for no IMDS version specified
  • Loading branch information
gcagle3 committed Jul 23, 2024
1 parent eed9799 commit 7b44cfc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 75 deletions.
33 changes: 16 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,49 +23,48 @@ jobs:
path: /tmp/logs
- store_test_results:
path: /tmp/logs
bats_ubuntu1604_imds_v1:
bats_ubuntu2004_imds_v1:
# 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 --exit-code-from bats_ubuntu1604_imds_v1 bats_ubuntu1604_imds_v1
bats_ubuntu1604_imds_v2:
- run: docker-compose up --exit-code-from bats_ubuntu2004_imds_v1 bats_ubuntu2004_imds_v1
bats_ubuntu2004_imds_v2:
# 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 --exit-code-from bats_ubuntu1604_imds_v2 bats_ubuntu1604_imds_v2

bats_ubuntu1804_imds_v1:
- run: docker-compose up --exit-code-from bats_ubuntu2004_imds_v2 bats_ubuntu2004_imds_v2
bats_ubuntu2004_no_imds:
# 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 --exit-code-from bats_ubuntu1804_imds_v1 bats_ubuntu1804_imds_v1
bats_ubuntu1804_imds_v2:
- run: docker-compose up --exit-code-from bats_ubuntu2004_no_imds bats_ubuntu2004_no_imds
bats_ubuntu2204_imds_v1:
# 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 --exit-code-from bats_ubuntu1804_imds_v2 bats_ubuntu1804_imds_v2
bats_ubuntu2004_imds_v1:
- run: docker-compose up --exit-code-from bats_ubuntu2204_imds_v1 bats_ubuntu2204_imds_v1
bats_ubuntu2204_imds_v2:
# 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 --exit-code-from bats_ubuntu2004_imds_v1 bats_ubuntu2004_imds_v1
bats_ubuntu2004_imds_v2:
- run: docker-compose up --exit-code-from bats_ubuntu2204_imds_v2 bats_ubuntu2204_imds_v2
bats_ubuntu2204_no_imds:
# 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 --exit-code-from bats_ubuntu2004_imds_v2 bats_ubuntu2004_imds_v2
- run: docker-compose up --exit-code-from bats_ubuntu2204_no_imds bats_ubuntu2204_no_imds

workflows:
version: 2
Expand All @@ -76,9 +75,9 @@ workflows:
context:
- AWS__PHXDEVOPS__circle-ci-test
- GITHUB__PAT__gruntwork-ci
- bats_ubuntu1604_imds_v1
- bats_ubuntu1604_imds_v2
- bats_ubuntu1804_imds_v1
- bats_ubuntu1804_imds_v2
- bats_ubuntu2004_imds_v1
- bats_ubuntu2004_imds_v2
- bats_ubuntu2004_no_imds
- bats_ubuntu2204_imds_v1
- bats_ubuntu2204_imds_v2
- bats_ubuntu2204_no_imds
36 changes: 0 additions & 36 deletions Dockerfile.ubuntu16.04.bats

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:22.04
MAINTAINER Gruntwork <[email protected]>

# Install basic dependencies
Expand Down
40 changes: 19 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ services:
- ./:/usr/local/src/bash-commons
working_dir: /usr/local/src/bash-commons/.circleci
command: ./shellcheck.sh
bats_ubuntu1604_imds_v1:
bats_ubuntu2004_imds_v1:
build:
context: ./
dockerfile: Dockerfile.ubuntu16.04.bats
dockerfile: Dockerfile.ubuntu20.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
# We intentionally omit the GRUNTWORK_BASH_COMMONS_IMDS_VERSION env var here to ensure the default behavior works as expected
bats_ubuntu1604_imds_v2:
environment:
# Signal to bash-commons module to use Instance Metadata Service version 1
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=1
bats_ubuntu2004_imds_v2:
build:
context: ./
dockerfile: Dockerfile.ubuntu16.04.bats
dockerfile: Dockerfile.ubuntu20.04.bats
volumes:
# Mount all the files so you have "hot reload" of all changes from the host
- ./:/usr/local/src/bash-commons
Expand All @@ -34,22 +36,21 @@ services:
environment:
# Signal to bash-commons module to use Instance Metadata Service version 2
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=2
bats_ubuntu1804_imds_v1:
bats_ubuntu2004_no_imds:
build:
context: ./
dockerfile: Dockerfile.ubuntu18.04.bats
dockerfile: Dockerfile.ubuntu20.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
# We intentionally omit the GRUNTWORK_BASH_COMMONS_IMDS_VERSION env var here to ensure the default behavior works as intended
bats_ubuntu1804_imds_v2:
bats_ubuntu2204_imds_v1:
build:
context: ./
dockerfile: Dockerfile.ubuntu18.04.bats
dockerfile: Dockerfile.ubuntu22.04.bats
volumes:
# Mount all the files so you have "hot reload" of all changes from the host
- ./:/usr/local/src/bash-commons
Expand All @@ -58,12 +59,12 @@ services:
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP
privileged: true
environment:
# Signal to bash-commons module to use Instance Metadata Service version 2
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=2
bats_ubuntu2004_imds_v1:
# Signal to bash-commons module to use Instance Metadata Service version 1
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=1
bats_ubuntu2204_imds_v2:
build:
context: ./
dockerfile: Dockerfile.ubuntu20.04.bats
dockerfile: Dockerfile.ubuntu22.04.bats
volumes:
# Mount all the files so you have "hot reload" of all changes from the host
- ./:/usr/local/src/bash-commons
Expand All @@ -72,19 +73,16 @@ services:
# Necessary so we can run a mock EC2 metadata service on port 80 on a special IP
privileged: true
environment:
# Signal to bash-commons module to use Instance Metadata Service version 1
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=1
bats_ubuntu2004_imds_v2:
# Signal to bash-commons module to use Instance Metadata Service version 2
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=2
bats_ubuntu2204_no_imds:
build:
context: ./
dockerfile: Dockerfile.ubuntu20.04.bats
dockerfile: Dockerfile.ubuntu22.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
environment:
# Signal to bash-commons module to use Instance Metadata Service version 2
- GRUNTWORK_BASH_COMMONS_IMDS_VERSION=2

0 comments on commit 7b44cfc

Please sign in to comment.