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 chart | |
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
- 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' |
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
class Animal: | |
def what_am_i(self) -> str: | |
return "I am a " | |
class Fox(Animal): | |
def what_am_i(self) -> str: | |
return super().what_am_i() + "Fox" |
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
<?php | |
// Headings and rows | |
$headings = array('ID', 'Name', 'Colour'); | |
$array = array( | |
array(1, 'Apple', 'Green'), | |
array(2, 'Banana', 'Yellow'), | |
array(3, 'Orange', 'Orange'), | |
); |
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 | |
NAMESPACE=test | |
kubectl proxy & | |
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json | |
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize | |
killall kubectl |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: example-uid | |
spec: | |
containers: | |
- name: test | |
image: busybox | |
command: ["/bin/sh", "echo", "$EXAMPLE_UID"] | |
env: |
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
echo '{"my-field": "something"}' > example.json | |
cat example.json | jq '.my-field' # Incorrect | |
# jq: error: key/0 is not defined at <top-level>, line 1: .my-field | |
# jq: 1 compile error | |
cat example.json | jq '."my-field"' # Correct | |
# "something" |
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 | |
# Project in the form vcs-type/organisation-name/repository-name | |
PROJECT=github/magickatt/example | |
# First, get all the Pipeline IDs for this workflow (triggered by a Git tag from a new release) | |
PIPELINE_IDS=(`curl --silent GET https://circleci.com/api/v2/project/$PROJECT/pipeline \ | |
--header "Circle-Token: $CIRCLE_API_TOKEN" \ | |
| jq --raw-output '.items | map(select(.vcs.tag != null)) | .[].id'`) |
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
FROM python:3.9-buster | |
# Prevents issues with cloning private PIP packages from GitHub | |
RUN --mount=type=ssh mkdir -p ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
RUN pip install --upgrade pip | |
RUN pip install pipenv | |
COPY . . | |
# Use the forwarded SSH agent when installing pip packages |
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
<?php | |
// Load application-specific configuration | |
try { | |
$basepath = __DIR__ . '/config'; | |
$configuration = Yaml::parse($basepath . '/config.yml'); | |
} catch (\InvalidArgumentException $exception) { | |
exit("Are you sure the configuration files exist?"); | |
} |