-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60f0fd1
commit ceb2b44
Showing
4 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Resources: | ||
MyBucket: | ||
Type: 'AWS::S3::Bucket' | ||
Properties: | ||
BucketName: my-application-bucket | ||
|
||
MyElasticBeanstalkApplication: | ||
Type: 'AWS::ElasticBeanstalk::Application' | ||
Properties: | ||
ApplicationName: my-application | ||
|
||
MyElasticBeanstalkEnvironment: | ||
Type: 'AWS::ElasticBeanstalk::Environment' | ||
Properties: | ||
ApplicationName: !Ref MyElasticBeanstalkApplication | ||
SolutionStackName: 64bit Amazon Linux 2018.03 v2.11.4 running Python 3.6 | ||
|
||
MyEKSCluster: | ||
Type: 'AWS::EKS::Cluster' | ||
Properties: | ||
Name: my-eks-cluster | ||
RoleArn: !GetAtt MyEKSClusterRole.Arn | ||
Version: '1.20' | ||
ResourcesVpcConfig: | ||
SubnetIds: | ||
- subnet-abcde012 | ||
- subnet-bcde012a | ||
- subnet-fghi345a | ||
SecurityGroupIds: | ||
- sg-abcde012 | ||
|
||
Resources: | ||
MyCustomResource: | ||
Type: 'Custom::MyCustomResource' | ||
Properties: | ||
ServiceToken: arn:aws:lambda:us-west-2:123456789012:function:my-function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Run Automated Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run tests | ||
run: | | ||
python -m unittest discover -s tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update_dependencies: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install and update Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt --upgrade | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install and update JavaScript dependencies | ||
run: | | ||
npm install | ||
npm update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: CI/CD Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: your-docker-username/quantum-genetic-algorithm:latest | ||
|
||
- name: Set up Kubectl | ||
uses: azure/setup-kubectl@v1 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Install AWS IAM Authenticator | ||
run: | | ||
curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-09-18/bin/linux/amd64/aws-iam-authenticator | ||
chmod +x ./aws-iam-authenticator | ||
sudo mv aws-iam-authenticator /usr/local/bin | ||
- name: Connect to EKS cluster | ||
run: | | ||
aws eks --region us-west-2 update-kubeconfig --name your-eks-cluster-name | ||
- name: Deploy to EKS | ||
run: | | ||
kubectl apply -f - <<EOF | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: quantum-genetic-algorithm | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: quantum-genetic-algorithm | ||
template: | ||
metadata: | ||
labels: | ||
app: quantum-genetic-algorithm | ||
spec: | ||
containers: | ||
- name: quantum-genetic-algorithm | ||
image: your-docker-username/quantum-genetic-algorithm:latest | ||
ports: | ||
- containerPort: 80 | ||
EOF | ||
kubectl apply -f - <<EOF | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: quantum-genetic-algorithm | ||
spec: | ||
selector: | ||
app: quantum-genetic-algorithm | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
type: LoadBalancer | ||
EOF |