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
export GITHUB_USER=magickatt | |
export GITHUB_TOKEN=secret | |
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk | |
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} |
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
name: Validate Helm charts | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
jobs: | |
validate: | |
runs-on: ubuntu-latest |
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
instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
# Find any unassociated Elastic IPs for this EKS cluster, and associate 1 to this node | |
allocate_eip () { | |
allocation_ids_string=$(aws ec2 describe-addresses --filters Name=tag:cluster,Values=${cluster} --query "Addresses[?NetworkInterfaceId == null ].AllocationId" --output text) | |
allocation_ids=($allocation_ids_string) | |
# Check if there is at least 1 Elastic IP free | |
if [ ${#allocation_ids[@]} -eq 0 ]; then | |
return 1 |
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
#!/bin/bash | |
brew install source-highlight | |
# Tell less where source-highlight is installed | |
# https://www.gnu.org/software/src-highlite/source-highlight.html#Using-source_002dhighlight-with-less | |
export LESSOPEN="| $(brew list source-highlight | grep src-hilite-lesspipe.sh) %s" | |
export LESS=' -R ' |
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
#!/usr/bin/env bash | |
# Combination of generating the JWT and the token | |
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app#generating-a-json-web-token-jwt | |
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app#using-a-json-web-token-jwt-to-authenticate-as-a-github-app | |
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app#generating-an-installation-access-token | |
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation | |
set -o pipefail |
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
name: CI | |
jobs: | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go |
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
package cmd | |
import ( | |
"fmt" | |
"os" | |
"text/tabwriter" | |
"github.com/you/your-project/cmd/testcmd" | |
"github.com/spf13/cobra" | |
) |
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
ctx := context.TODO() | |
queueName := "something" | |
endpointURL := "http://localhost:9324" | |
messageBody := "test" | |
// Create a custom endpoint resolver for ElasticMQ | |
elasticmqResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { | |
if service == sqs.ServiceID { | |
return aws.Endpoint{URL: endpointURL}, nil | |
} |
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
resource "google_service_account" "service_account" { | |
account_id = "test | |
display_name = "Test" | |
} | |
resource "google_service_account_key" "service_account" { | |
service_account_id = google_service_account.service_account.name | |
public_key_type = "TYPE_X509_PEM_FILE" | |
} |
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
- name: 'gcr.io/cloud-builders/git' | |
secretEnv: ['SSH_KEY'] | |
entrypoint: 'bash' | |
args: | |
- -c | |
- | | |
echo "$$SSH_KEY" >> /root/.ssh/id_rsa | |
chmod 400 /root/.ssh/id_rsa | |
volumes: | |
- name: 'ssh' |
NewerOlder