Skip to content

Commit

Permalink
feat: script update
Browse files Browse the repository at this point in the history
  • Loading branch information
RamaRaju-vj committed Jul 2, 2024
1 parent 0f8ac56 commit e9fbc1d
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions .github/workflows/jenkins-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,13 @@ jobs:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
JENKINS_HOME: /var/lib/jenkins



steps:
- name: Checkout code
uses: actions/checkout@v2


- name: Install unzip
run: sudo apt install unzip -y

- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region ${{ secrets.AWS_REGION }}
- name: Install kubectl and AWS IAM Authenticator
run: |
sudo apt-get update
sudo curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
sudo chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin
sudo curl -Lo aws-iam-authenticator "https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.6.11/aws-iam-authenticator_0.6.11_linux_amd64"
sudo chmod +x ./aws-iam-authenticator
sudo mv ./aws-iam-authenticator /usr/local/bin
echo "Kubectl $(kubectl version --client)"
echo "AWS IAM Authenticator $(aws-iam-authenticator version)"
- name: Update kubeconfig for EKS cluster
run: |
mkdir -p $JENKINS_HOME/.kube
aws eks update-kubeconfig --name ram-eks-cluster --region $AWS_REGION --kubeconfig $JENKINS_HOME/.kube/config
sudo chown -R jenkins:jenkins $JENKINS_HOME/.kube
- name: Validate Kubernetes Connection
run: |
export KUBECONFIG=$JENKINS_HOME/.kube/config
kubectl version
kubectl get nodes

- name: Setup `packer`
uses: hashicorp/setup-packer@main
Expand Down

0 comments on commit e9fbc1d

Please sign in to comment.