Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightsail instance #124

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function create_load_balancer() {

}

aws lightsail get-certificates --certificate-name ${PREFIX}-tvarit-com > /dev/null
# aws lightsail get-certificates --certificate-name ${PREFIX}-tvarit-com > /dev/null

echo "Creating production database..."
aws lightsail create-relational-database \
Expand Down Expand Up @@ -108,9 +108,9 @@ fi

DB_ENDPOINT=$(aws lightsail get-relational-database --relational-database-name ${PREFIX}-next-grafana-db --output text --query 'relationalDatabase.masterEndpoint.address')
DB_PASSWORD=$(aws lightsail get-relational-database-master-user-password --relational-database-name ${PREFIX}-next-grafana-db --output text --query masterUserPassword)
#SIGNING_SECRET=$(aws secretsmanager get-secret-value --secret-id grafana-signing-secret --output text --query SecretString)
SIGNING_SECRET=$(aws secretsmanager get-secret-value --secret-id grafana-signing-secret --output text --query SecretString)

#AWS-030
#AWS-016
AWS_ACCESS_KEY=$(aws secretsmanager get-secret-value --secret-id /credentials/grafana-user/access-key --output text --query SecretString)
AWS_SECRET_KEY=$(aws secretsmanager get-secret-value --secret-id /credentials/grafana-user/secret-key --output text --query SecretString)

Expand Down Expand Up @@ -149,9 +149,9 @@ docker build --tag grafana/grafana:next-${PREFIX} .

#push Docker image to ECR
echo "push docker image to ECR........."
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 047870419389.dkr.ecr.eu-central-1.amazonaws.com
docker tag grafana/grafana:next-${PREFIX} 047870419389.dkr.ecr.eu-central-1.amazonaws.com/lightsail:latest
docker push 047870419389.dkr.ecr.eu-central-1.amazonaws.com/lightsail:latest
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 250373516626.dkr.ecr.eu-central-1.amazonaws.com
docker tag grafana/grafana:next-${PREFIX} 250373516626.dkr.ecr.eu-central-1.amazonaws.com/lightsailinstance:latest
docker push 250373516626.dkr.ecr.eu-central-1.amazonaws.com/lightsailinstance:latest

instance_name=grafana-${PREFIX}
static_ip_name=grafana-ip-${PREFIX}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to 030
name: Deploy to Dev

on:
workflow_dispatch:
Expand All @@ -9,8 +9,8 @@ jobs:
environment: development
env:
AWS_DEFAULT_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_030 }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_030 }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
SMTP_HOST: ${{ secrets.SMTP_HOST }}
Expand All @@ -19,4 +19,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
bash .github/tvarit/deploy_to_dev_30.sh test
bash .github/tvarit/deploy_to_dev_16.sh test
6 changes: 3 additions & 3 deletions lightsail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AWS_REGION="eu-central-1"
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY

docker login -u AWS -p $(aws ecr get-login-password --region eu-central-1) 047870419389.dkr.ecr.eu-central-1.amazonaws.com
docker pull 047870419389.dkr.ecr.eu-central-1.amazonaws.com/lightsail:latest
docker login -u AWS -p $(aws ecr get-login-password --region eu-central-1) 250373516626.dkr.ecr.eu-central-1.amazonaws.com
docker pull 250373516626.dkr.ecr.eu-central-1.amazonaws.com/lightsailinstance:latest
docker images >> test.txt #for testing
docker run -d -p 80:3000 047870419389.dkr.ecr.eu-central-1.amazonaws.com/lightsail:latest
docker run -d -p 80:3000 250373516626.dkr.ecr.eu-central-1.amazonaws.com/lightsailinstance:latest
Loading