This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1214 from gene1wood/change-cicd-sequence
Change CI/CD sequence for v1.38.5
- Loading branch information
Showing
6 changed files
with
109 additions
and
119 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
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
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
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 |
---|---|---|
@@ -1,72 +1,69 @@ | ||
{ | ||
"variables": { | ||
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", | ||
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}", | ||
"aws_security_token": "{{env `AWS_SESSION_TOKEN`}}" | ||
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}", | ||
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}", | ||
"aws_security_token": "{{env `AWS_SESSION_TOKEN`}}" | ||
}, | ||
"builders": [{ | ||
"type": "amazon-ebs", | ||
"region": "us-west-2", | ||
"access_key": "{{user `aws_access_key`}}", | ||
"secret_key": "{{user `aws_secret_key`}}", | ||
"token": "{{user `aws_security_token`}}", | ||
"source_ami": "ami-0d1000aff9a9bad89", | ||
"instance_type": "t2.large", | ||
"ssh_pty" : "true", | ||
"ssh_username": "ec2-user", | ||
"ami_name": "mozdef_{{timestamp}}", | ||
"launch_block_device_mappings": [ | ||
{ | ||
"delete_on_termination": true, | ||
"device_name": "/dev/xvda", | ||
"volume_size": 14 | ||
"builders": [ | ||
{ | ||
"type": "amazon-ebs", | ||
"region": "us-west-2", | ||
"access_key": "{{user `aws_access_key`}}", | ||
"secret_key": "{{user `aws_secret_key`}}", | ||
"token": "{{user `aws_security_token`}}", | ||
"source_ami": "ami-0d1000aff9a9bad89", | ||
"instance_type": "t2.large", | ||
"ssh_pty": "true", | ||
"ssh_username": "ec2-user", | ||
"ami_name": "mozdef_{{timestamp}}", | ||
"launch_block_device_mappings": [ | ||
{ | ||
"delete_on_termination": true, | ||
"device_name": "/dev/xvda", | ||
"volume_size": 14 | ||
} | ||
], | ||
"ami_description": "An automated build of MozDef triggered via the makefile.", | ||
"ami_groups": [ | ||
"all" | ||
], | ||
"run_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"run_volume_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"snapshot_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"tags": { | ||
"github:Branch": "{{ user `github_branch`}}", | ||
"buildTimestamp": "{{timestamp}}", | ||
"app": "mozdef" | ||
} | ||
], | ||
"ami_description": "An automated build of MozDef triggered via the makefile.", | ||
"ami_groups": [ | ||
"all" | ||
], | ||
"run_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"run_volume_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"snapshot_tags": { | ||
"app": "packer-builder-mozdef" | ||
}, | ||
"tags": { | ||
"github:Branch": "{{ user `github_branch`}}", | ||
"buildTimestamp": "{{timestamp}}", | ||
"app": "mozdef" | ||
} | ||
}], | ||
"provisioners": [ | ||
{ "type": "shell", | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"set -e", | ||
"sudo yum update -y", | ||
"sudo yum makecache fast", | ||
"sudo yum install -y glibc-devel gcc libstdc++ libffi-devel zlib-devel make ", | ||
"sudo yum install -y mysql-devel python python-devel python-pip", | ||
"sudo yum install -y git", | ||
"sudo yum install -y docker", | ||
"sudo yum install -y python3", | ||
"sudo pip install virtualenv ", | ||
"sudo pip install docker-compose", | ||
"sudo yum install -y glibc-devel gcc libstdc++ libffi-devel zlib-devel make mysql-devel python python-devel python-pip git docker python3", | ||
"sudo pip install virtualenv docker-compose", | ||
"sudo systemctl enable docker", | ||
"sudo systemctl start docker", | ||
"sudo mkdir -p /opt/mozdef/", | ||
"sudo mkdir --verbose --parents /opt/mozdef/", | ||
"sudo git clone https://github.com/mozilla/MozDef /opt/mozdef", | ||
"cd /opt/mozdef && sudo git checkout {{ user `github_branch`}}", | ||
"cd /opt/mozdef && sudo git rev-parse HEAD", | ||
"cd /opt/mozdef && sudo touch docker/compose/cloudy_mozdef.env docker/compose/rabbitmq.env docker/compose/cloudy_mozdef_mq_cloudtrail.env docker/compose/cloudy_mozdef_mq_sns_sqs.env docker/compose/cloudy_mozdef_kibana.env", | ||
"cd /opt/mozdef && sudo make BRANCH={{ user `github_branch`}} set-version-and-fetch-docker-container", | ||
"cd /opt/mozdef && sudo docker-compose -f docker/compose/docker-compose-cloudy-mozdef.yml -p mozdef pull", | ||
"rm -rf /home/ec2-user/.ssh/authorized_keys", | ||
"rm -rf /home/ec2-user/.ssh/known_hosts", | ||
"sudo rm -rf /tmp/*", | ||
"sudo rm -rf /home/ec2-user/.bash_history", | ||
"sudo rm -rf /root/.ssh" | ||
]} | ||
] | ||
"cd /opt/mozdef", | ||
"sudo git checkout {{ user `github_branch`}}", | ||
"sudo git rev-parse HEAD", | ||
"sudo touch docker/compose/cloudy_mozdef.env docker/compose/rabbitmq.env docker/compose/cloudy_mozdef_mq_cloudtrail.env docker/compose/cloudy_mozdef_mq_sns_sqs.env docker/compose/cloudy_mozdef_kibana.env", | ||
"sudo sed --in-place s/latest/{{ user `github_branch`}}/g docker/compose/docker-compose-cloudy-mozdef.yml", | ||
"sudo docker-compose --file docker/compose/docker-compose-cloudy-mozdef.yml --project-name mozdef pull", | ||
"sudo rm --recursive --force --verbose /tmp/* /home/ec2-user/.bash_history /root/.ssh /home/ec2-user/.ssh/known_hosts /home/ec2-user/.ssh/authorized_keys" | ||
] | ||
} | ||
] | ||
} |
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
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