## Kubernetes: Load config files dinamically (conf.yml)
export KUBECONFIG=$(find $HOME/.kube -name "*.conf.yml" -print0 | tr '\0' ':' | sed 's/:$//')
This file contains hidden or 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
| version: 0.2 | |
| phases: | |
| pre_build: | |
| commands: | |
| - echo Logging in to Amazon ECR... | |
| - aws --version | |
| - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com | |
| - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME | |
| - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) |
This file contains hidden or 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 hidden or 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
| name: Deploy to S3 and Invalidate CloudFront Cache | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| build-and-deploy: |
sudo nano /etc/systemd/system/my-service.serviceNOTE: And add the following content from section Service File Examples
This script automates the setup of a Redis container with secure access via stunnel. It generates a unique ID for the Redis instance, a secure password, and finds free ports for Redis and stunnel.
- Starts a Redis container with a unique volume and password.
- Sets up a stunnel container to provide secure access to the Redis instance.
- Assumes the availability of a wildcard certificate, key, and CA file for your domain.
This file contains hidden or 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
| #! /bin/bash | |
| CLOUDCLUSTERS_HOME="/cloudclusters" | |
| LOG_FILE="$CLOUDCLUSTERS_HOME/logs/db-backup.log" | |
| SCRIPT_DIR="$CLOUDCLUSTERS_HOME/scripts" | |
| BACKUP_DIR="$CLOUDCLUSTERS_HOME/backups" | |
| S3_BUCKET="s3://<bucket_name>" | |
| DB_NAME="<dbname>" | |
| DB_USER="<dbuser>" |
This file contains hidden or 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
| # Base image | |
| FROM alpine:3.18.4 as base | |
| RUN apk update && apk upgrade | |
| RUN apk add --no-cache make yasm binutils git nodejs npm | |
| RUN npm install -g yarn | |
| # Compile asmttpd http server | |
| from base as build-asmttpd | |
| RUN git clone --depth 1 https://github.com/nemasu/asmttpd |
This file contains hidden or 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
| # Build stage | |
| from node:18-alpine3.17 as build | |
| WORKDIR /app | |
| # Copy whole project | |
| COPY ../../ . | |
| # Install dependencies | |
| RUN yarn install |