This file contains hidden or 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
| license: mit |
This file contains hidden or 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 | |
| attemp=5 | |
| count=0 | |
| while ! $(./check_script.sh >/tmp/script_stdout.log 2>/tmp/script_stderr.log) && [[ $count -lt $attemp ]]; do | |
| count=$((count + 1)) | |
| echo "Check failed. Retrying ($(($attemp - count)) attemp remaining)..." | |
| echo "==================DEBUG===================" | |
| echo "STDOUT:" | |
| cat /tmp/script_stdout.log |
This file contains hidden or 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 | |
| change_files="$(git diff --name-only HEAD HEAD~1 | xargs echo)" | |
| test_files=$@ | |
| for file in $test_files; do | |
| if [[ $change_files =~ (^|[[:space:]])"$file"($|[[:space:]]) ]]; then | |
| echo "contain file $file" | |
| else | |
| echo "not contain file $file" |
This file contains hidden or 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 | |
| ISMASTER=$(/usr/bin/mongo --quiet --eval 'db.isMaster().ismaster') | |
| if [ "$ISMASTER" = "true" ] | |
| then | |
| exit 0 | |
| else | |
| exit 2 | |
| fi |
This file contains hidden or 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
| @Library('gitlab_lib') _ | |
| import org.jenkinsci.plugins.pipeline.modeldefinition.Utils | |
| final project_id = "nguyenthang98%2Fexample-project-jenkins" | |
| node("Slave") { | |
| checkout scm | |
| final latest_commit = sh(script: 'git rev-parse --verify HEAD', returnStdout: true) | |
| final sha = env.gitlabAfter ?:latest_commit; |
This file contains hidden or 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.6.12-alpine | |
| RUN pip install beautifulsoup4 | |
| WORKDIR /opt/python | |
| CMD ["python"] |
This file contains hidden or 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
| job "echo" { | |
| datacenters = ["dc1"] | |
| type = "service" | |
| group "web" { | |
| count = 1 | |
| constraint { | |
| attribute = "${attr.unique.hostname}" |
This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| "strings" | |
| "strconv" | |
| ) | |
| func makeSeq(min, max int) []int { | |
| a := make([]int, max-min+1) |
This file contains hidden or 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
| client { | |
| enabled = true | |
| node_class = "" | |
| no_host_uuid = false | |
| servers = ["10.253.155.163","10.253.155.17","10.253.155.102"] | |
| max_kill_timeout = "30s" |
This file contains hidden or 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 | |
| # dump schema | |
| cqlsh -u cassandra -p cassandra -e 'DESC KEYSPACE lwadb' >/scripts/schema_lwadb.cql | |
| # dump data | |
| cqlsh -k lwadb -u cassandra -p cassandra -e "COPY users to '/scripts/data_users.csv' with header=true" | |
OlderNewer