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 | |
DEFAULT_BACKEND_S3BUCKET="<s3-bucket-name>" | |
DEFAULT_BACKEND_PROFILE="<s3-bucket-aws-profile>" | |
DEFAULT_BACKEND_REGION="<s3-bucket-region>" | |
DEFAULT_TERRAFORM_PROFILE="<default-aws-profile>" | |
DEFAULT_TERRAFORM_REGION="<default-aws-region>" | |
GIT_REMOTE_URL=$(git config --get remote.origin.url) |
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
# get project id | |
$response=Invoke-WebRequest -Method GET -Headers @{"PRIVATE-TOKEN"="$apitoken";"Content-Type"="application/json"} -Uri "$gitremoteDomain/api/v4/projects" | |
$content=ConvertFrom-Json $([String]::new($response.Content)) | |
foreach ($c in $content){ | |
if($c.name -eq $projectname){ | |
$projectid = $c.id | |
break | |
} | |
} |
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
#powershell | |
# just put the uri without domain in to this variable | |
$gitremoteUri="xxxx/xxxxxt/xxx" | |
$relativeRootPath="" | |
$gitremoteTreeLevel=$gitremoteUri.split('/').length | |
for ($i=0; $i -lt $gitremoteTreeLevel ; $i++){ | |
$relativeRootPath+="../" | |
} |
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
#find node names | |
kubectl get no | |
set NODENAME=xxxxxxxxxxxxxxx | |
kubectl cordon $NODENAME | |
#check pod on node | |
kubectl get pods --all-namespaces --field-selector spec.nodeName=$NODENAME -o wide |
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
# | |
# Build stage | |
# | |
FROM maven:3.6.0-jdk-11-slim AS build | |
COPY src /home/app/src | |
COPY pom.xml /home/app | |
RUN mvn -f /home/app/pom.xml clean package | |
# | |
# Package stage |
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
#Provide the subscription Id where snapshot is created | |
$SubscriptionId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
#Provide the name of your resource group where snapshot is created | |
$resourceGroupName="rgname" | |
#Provide the snapshot name | |
$SnapshotName = "snapshotname" | |
#Provide Shared Access Signature (SAS) expiry duration in seconds e.g. 3600. | |
#Know more about SAS here: https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-shared-access-signature-part-1 | |
$sasExpiryDuration = "3600" | |
#Provide storage account name where you want to copy the snapshot. |
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
function add-https-support(){ | |
if ("TrustAllCertsPolicy" -as [type]) { | |
#"TrustAllCertsPolicy is already loaded" | |
}else{ | |
#add https support | |
add-type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { |
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
<match fluent.**> | |
@type null | |
</match> | |
<source> | |
@type tail | |
@id in_tail_container_logs | |
limit_recently_modified 1s | |
path /var/log/containers/*.log | |
pos_file /var/rancher-fluentd/db/fluentd-containers.log.pos |
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
1. Login to the container | |
`docker exec -it registry sh` | |
2. Define variables matching your container and container version: | |
```export NAME="google/cadvisor" | |
export VERSION="v0.24.1"``` | |
3. Move to the the registry directory: | |
`cd /var/lib/registry/docker/registry/v2` |
NewerOlder