mysqldump -v -h 127.0.0.1 -P 3306 -u root -p --default-character-set=utf8 sonar > sonar_backup.sql
mysql -u username -p database_name < backup_name.sql
#!/usr/bin/env bash | |
set -e | |
# Function to delete an RDS instance. | |
# | |
# Arguments | |
# - $1: The identifier of the RDS instance to be deleted. | |
# | |
delete_instance() { |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
version: 0.0 | |
os: linux | |
files: | |
- source: / | |
destination: /home/ec2-user/node | |
permissions: | |
- object: /home/ec2-user | |
owner: ec2-user | |
group: ec2-user | |
type: |
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Public VPC and subnets | |
Resources: | |
# | |
# Public VPC | |
# | |
PublicVpc: |
version: '3' | |
services: | |
ghost: | |
image: ghost:2-alpine | |
restart: always | |
labels: | |
- "traefik.enable=true" | |
- "traefik.docker.network=traefik_public" | |
- "traefik.backend=ghost" |
--- | |
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) | |
- COMMIT_HASH="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)" | |
- IMAGE_TAG="${COMMIT_HASH:=latest}" | |
- printenv |