Skip to content

Commit

Permalink
DUPLO-16826 Add amazon-ecr-credential-helper part 1
Browse files Browse the repository at this point in the history
This adds the credential helper to Ubuntu 20, 22 and AmazonLinux2
flavor builds. However, it does not yet exclude this being added
to the GCP build which is unnecessary in that context.
This will enable testing the addition for AMIs.
  • Loading branch information
duplodavid committed Apr 17, 2024
1 parent d8d3bae commit 5fde458
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# AWS credentials
- name: Packer AWS Role
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

# Upload the image manifest
- name: Attach Manifest
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packer-manifest.json
path: packer-manifest.json
Expand All @@ -117,7 +117,7 @@ jobs:
duplo_token: "${{ secrets.GOVCLOUD_DUPLO_TOKEN }}"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# AWS credentials
- name: Tenant AWS JIT
Expand All @@ -127,7 +127,7 @@ jobs:

# AWS credentials
- name: Packer AWS Role
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
Expand Down
8 changes: 6 additions & 2 deletions AgentAmazonLinux2/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -115,6 +115,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -139,6 +141,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json
###
options=`cat /etc/default/docker | grep bridge`
echo $options
Expand Down Expand Up @@ -197,7 +201,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
6 changes: 4 additions & 2 deletions AgentUbuntu20/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -112,6 +112,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json
###
options=`cat /etc/default/docker | grep bridge`
echo $options
Expand Down Expand Up @@ -165,7 +167,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
8 changes: 6 additions & 2 deletions AgentUbuntu22/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -116,6 +116,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -140,6 +142,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

###
options=`cat /etc/default/docker | grep bridge`
Expand Down Expand Up @@ -205,7 +209,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down
8 changes: 6 additions & 2 deletions AgentUbuntu22/SetupPython3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ubuntuInstall () {
}


installDependancies () {
installDependencies () {

if [ "$OS" = "centos" ]; then
echo "Centos Installing docker"
Expand Down Expand Up @@ -119,6 +119,8 @@ installDependancies () {
sudo amazon-linux-extras install -q -y docker
sudo yum install -q -y docker
sudo usermod -a -G docker ec2-user
sudo yum install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

sudo yum install -q -y git wget curl net-tools vim
sudo yum install -q -y yum-utils
Expand All @@ -143,6 +145,8 @@ installDependancies () {
echo "Ubuntu Installing Container Management Service"
sudo apt-get update
sudo apt install -q -y python3-dev python3-pip bridge-utils python3-virtualenv gcc
sudo apt install -q -y amazon-ecr-credential-helper
mkdir -p ~/.docker && echo '{ "credsStore": "ecr-login" }' > ~/.docker/config.json

###
options=`cat /etc/default/docker | grep bridge`
Expand Down Expand Up @@ -208,7 +212,7 @@ echo "Step 1: Install Docker and setup docker bridge";
echo "--------------------------OS=$OS VER=$VER-------------------------------------1"
echo; echo;

installDependancies
installDependencies



Expand Down

0 comments on commit 5fde458

Please sign in to comment.