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
import gitlab | |
import os | |
import subprocess | |
from gitlab.v4.objects.jobs import ProjectJob | |
from gitlab.v4.objects.pipelines import ProjectPipeline | |
def pprint_job(job: ProjectJob): | |
return f"ProjectJob<name={job.attributes.get('name', None)}, finished_at={job.attributes.get('finished_at')[0:16]}>" |
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
import os | |
from pyspark.sql import SparkSession | |
# create the spark session on a cluster of multiple cores | |
DIR_JSONS = '/tmp/in/jsons' | |
SPARK = SparkSession.builder.appName('APP_NAME').getOrCreate() | |
sc = SPARK.sparkContext | |
# execute a shell command using python | |
def os_shell_jq(filepath): |
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
grafana_synthetic_monitoring_check.all: Creating... | |
2021-12-28T18:29:30.583Z [WARN] Provider "registry.terraform.io/grafana/grafana" produced an invalid plan for grafana_synthetic_monitoring_check.all, but we are tolerating it because it is using the legacy plugin SDK. | |
The following problems may be the cause of any confusing errors from downstream operations: | |
- .basic_metrics_only: planned value cty.True for a non-computed attribute | |
- .frequency: planned value cty.NumberIntVal(60000) for a non-computed attribute | |
- .probes: planned value cty.NullVal(cty.Set(cty.Number)) does not match config value cty.SetValEmpty(cty.Number) | |
- .alert_sensitivity: planned value cty.StringVal("none") for a non-computed attribute | |
- .timeout: planned value cty.NumberIntVal(3000) for a non-computed attribute | |
2021-12-28T18:29:30.583Z [TRACE] checkPlannedChange: Verifying that actual change (action Create) matches planned change (action Create) | |
2021-12-28T18:29:30.583Z [TRACE] readResourceInstanceSt |
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
Terraform used the selected providers to generate the following execution | |
plan. Resource actions are indicated with the following symbols: | |
+ create | |
Terraform will perform the following actions: | |
# grafana_synthetic_monitoring_check.all will be created | |
+ resource "grafana_synthetic_monitoring_check" "all" { | |
+ alert_sensitivity = "none" | |
+ basic_metrics_only = true | |
+ enabled = true | |
+ frequency = 60000 |
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
Error: authorization token required | |
59│ | |
60│ with data.grafana_synthetic_monitoring_probes.main, | |
61│ on probes.tf line 2, in data "grafana_synthetic_monitoring_probes" "main": | |
62│ 2: data "grafana_synthetic_monitoring_probes" "main" {} | |
63│ | |
64╵ |
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/sh | |
OPEN_MERGE_REQUESTS="[\"my/project!14\", \"my/other/project!2\"]" | |
# parse input args and environment variables | |
if [ -z "$OPEN_MERGE_REQUESTS" ]; then echo "$0: need OPEN_MERGE_REQUESTS"; exit 1; fi | |
if [ -z "$GITLAB_TOKEN" ]; then echo "$0: need GITLAB_TOKEN"; exit 1; fi | |
curl_token="PRIVATE-TOKEN: ${GITLAB_TOKEN}" |
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
import os | |
from atlassian import Confluence | |
CONFLUENCE = Confluence( | |
url=f"https://{os.environ['CONFLUENCE_SITE']}.atlassian.net", | |
username=os.environ['CONFLUENCE_USER'], | |
password=os.environ['CONFLUENCE_TOKEN'], | |
cloud=True) |
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
if [ -z "${GRAFANA_API_TOKEN}" ]; then | |
echo Error: missing environment variable: GRAFANA_API_TOKEN | |
exit 1 | |
fi | |
DASHBOARD_SLUGS="${*}" | |
if [ -z "${DASHBOARD_SLUGS}" ]; then | |
echo Error: missing argument1...n: DASHBOARD_SLUGS | |
exit 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 | |
# this script will: | |
# 1. read in file argument 1, $DIFF_FILE_IN | |
# 2. format text to Markdown diff code section | |
# 3. write out file argument 2, $DIFF_FILE_OUT | |
# https://gitlab.com/gitlab-org/gitlab/-/issues/15582 | |
set -e |
NewerOlder