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
#!/opt/datadog-agent/embedded/bin/python | |
import os | |
import sys | |
import time | |
import re | |
import subprocess | |
import logging | |
# To keep this lightweight we assume the following |
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 jenkins.* | |
import hudson.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
import hudson.plugins.sshslaves.*; | |
import hudson.model.* | |
import jenkins.model.* | |
import hudson.security.* |
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
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { | |
log_not_found off; | |
proxy_cache_valid any 1m; | |
proxy_pass http://local_backend$uri$is_args$args; | |
add_header X-Proxy-Cache $upstream_cache_status; | |
} |
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
git_move() { # where $1 is your origin name and $2 is the new origin url | |
git fetch --all | |
git pull --all | |
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done | |
git remote remove $1 | |
git remote add $1 $2 | |
for b in `git branch | grep -v -- '*'`; do git push -u origin $b; done | |
git push --tags | |
} |
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 a version from a json: | |
REMOTE_VERSION=$(curl -s URL_THAT_RETURNS_JSON|python -c 'import json,sys;obj=json.load(sys.stdin);print obj["version"]') | |
# Get latest version from Artifactory: | |
REMOTE_VERSION=$(curl -s http://{{artifactory_integration_host}}:8081/artifactory/api/npm/libs-npm-virtual/ww-node-configs/latest|python -c 'import json,sys;obj=json.load(sys.stdin);version = "0.0.0" if obj.get("version") is None else obj["version"];print version') | |
# To stop a job in jenkins if this build is not for a newer version: | |
python -c 'import sys; exit(0) if sys.argv[1] > sys.argv[2] else exit(1)' $LOCAL_VERSION $REMOTE_VERSION |
NewerOlder