mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 08:10:50 +00:00
consolidated some commands
This commit is contained in:
parent
91e93cb975
commit
d48da50cf6
1 changed files with 6 additions and 22 deletions
|
|
@ -176,6 +176,7 @@ build container fb:
|
|||
- docker push $tag
|
||||
- echo Created docker featurebase image with tag "$tag"
|
||||
|
||||
# deploy EC2 instance and upload featurebase binary
|
||||
deploy node for linux amd64:
|
||||
stage: integration
|
||||
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
|
||||
|
|
@ -205,7 +206,7 @@ deploy node for linux amd64:
|
|||
- SECURITY_GROUP=$(aws ec2 describe-security-groups --filter Name=vpc-id,Values=vpc-03a4ba3d5b7c8f978 --query 'SecurityGroups[*].[GroupId]' --output text --profile $PROFILE)
|
||||
- SUBNET_ID=$(aws ec2 describe-subnets --filters 'Name=vpc-id,Values=vpc-03a4ba3d5b7c8f978' 'Name=availability-zone,Values=us-east-2a' --query 'Subnets[0].SubnetId' --output text --profile $PROFILE)
|
||||
- aws ec2 run-instances --image-id $AMI --instance-type $INSTANCE --security-group-ids $SECURITY_GROUP --subnet-id $SUBNET_ID --key-name gitlab-featurebase-dev --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=linux-amd64-node}]' --profile $PROFILE --user-data file://.gitlab/cloud-init.sh
|
||||
- sleep 120
|
||||
- sleep 120 # Need to wait for the EC2 instance to launch and run the initialization commands passed through user-data
|
||||
- PUBLIC_IP=$(aws ec2 describe-instances --filters 'Name=tag:Name, Values=linux-amd64-node' 'Name=instance-state-name, Values=running' --query 'Reservations[*].Instances[*].PublicIpAddress' --output text --profile $PROFILE)
|
||||
- echo $PUBLIC_IP
|
||||
- INSTANCE_ID=$(aws ec2 describe-instances --filters 'Name=tag:Name, Values=linux-amd64-node' 'Name=instance-state-name, Values=running' --query 'Reservations[*].Instances[*].InstanceId' --output text --profile $PROFILE)
|
||||
|
|
@ -213,31 +214,15 @@ deploy node for linux amd64:
|
|||
- scp -o StrictHostKeyChecking=no -i gitlab-featurebase-dev.pem featurebase_linux_amd64 ec2-user@$PUBLIC_IP:.
|
||||
- scp -o StrictHostKeyChecking=no -i gitlab-featurebase-dev.pem .gitlab/featurebase.conf .gitlab/featurebase.service ec2-user@$PUBLIC_IP:.
|
||||
- aws ec2 associate-iam-instance-profile --instance-id $INSTANCE_ID --iam-instance-profile Name=featurebase-dev-ssm
|
||||
needs:
|
||||
- sleep 240 # needed to allow enough time for the ssm to take into effect before the next command can get called
|
||||
- aws ssm send-command --document-name "AWS-RunShellScript" --instance-ids $INSTANCE_ID --cli-input-json file://.gitlab/configureFeatureBase.json --profile $PROFILE --region us-east-2
|
||||
- sleep 120
|
||||
needs:
|
||||
- job: build for linux amd64
|
||||
artifacts:
|
||||
paths:
|
||||
- linux-amd64-instance.txt
|
||||
|
||||
run featurebase in linux amd64 node:
|
||||
stage: integration
|
||||
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
|
||||
variables:
|
||||
INSTANCE_ID: ""
|
||||
PROFILE: "default"
|
||||
before_script:
|
||||
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
|
||||
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
|
||||
- aws configure set region "us-east-2"
|
||||
- aws configure set aws_profile $PROFILE
|
||||
- INSTANCE_ID=$(cat linux-amd64-instance.txt)
|
||||
script:
|
||||
- sleep 240 # needed to allow enough time for the ssm to take into effect before the next command can get called
|
||||
- aws ssm send-command --document-name "AWS-RunShellScript" --instance-ids $INSTANCE_ID --cli-input-json file://.gitlab/configureFeatureBase.json --profile $PROFILE --region us-east-2
|
||||
- sleep 120
|
||||
needs:
|
||||
- job: deploy node for linux amd64
|
||||
|
||||
terminate node for linux amd64:
|
||||
stage: integration
|
||||
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
|
||||
|
|
@ -253,4 +238,3 @@ terminate node for linux amd64:
|
|||
- aws ec2 terminate-instances --instance-ids $INSTANCE_ID
|
||||
needs:
|
||||
- job: deploy node for linux amd64
|
||||
- job: run featurebase in linux amd64 node
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue