1
0
Fork 0

Fix config
continuous-integration/drone/push Build is failing Details

main
Ambrose Chua 2020-04-28 12:04:34 +08:00
parent 88e25c1051
commit 0d5fe205fe
Signed by: ambrose
GPG Key ID: BC367D33F140B5C2
4 changed files with 129 additions and 34 deletions

71
.local/bin/update-drone-docker Executable file
View File

@ -0,0 +1,71 @@
#!/bin/bash
DRONE_SERVER=${DRONE_SERVER:="https://ci.makerforce.io"}
DRONE_TOKEN=${DRONE_TOKEN:=""}
echo
echo "This script updates Docker logins on all Drone repos"
echo
path_to_httpie=$(which http)
if [ ! -x "$path_to_httpie" ] ; then
echo "HTTPie not installed. Please install it at (https://httpie.org/doc#installation)"
fi
path_to_jq=$(which jq)
if [ ! -x "$path_to_jq" ] ; then
echo "JQ not installed. Please install it at (https://stedolan.github.io/jq/download/)"
fi
if [ -z $DRONE_TOKEN ]; then
echo "Enter Drone token ($DRONE_SERVER/account/token)"
echo -n "> "
read DRONE_TOKEN
echo
fi
echo "Enter Docker username"
echo -n "> "
read docker_username
echo
echo "Enter Docker password"
echo -n "> "
read -s docker_password
echo
echo
echo "Fetching repo list..."
repo_list=$(http GET $DRONE_SERVER/api/user/repos Authorization:"Bearer $DRONE_TOKEN" | jq .[].slug -r)
#repo_enabled_list=$(http GET $DRONE_SERVER/api/user/repos Authorization:"Bearer $DRONE_TOKEN" | jq .[].enabled -r)
for r in $repo_list; do
echo "Updating docker_username in $r..."
http --check-status -b PATCH \
$DRONE_SERVER/api/repos/$r/secrets/docker_username \
Authorization:"Bearer $DRONE_TOKEN" \
data="$docker_username" \
pull_request:=false \
|| http --check-status -b POST \
$DRONE_SERVER/api/repos/$r/secrets \
Authorization:"Bearer $DRONE_TOKEN" \
name="docker_username" \
data="$docker_username" \
pull_request:=false
echo "Updating docker_password in $r..."
http --check-status -b PATCH \
$DRONE_SERVER/api/repos/$r/secrets/docker_password \
Authorization:"Bearer $DRONE_TOKEN" \
data="$docker_password" \
pull_request:=false \
|| http --check-status -b POST \
$DRONE_SERVER/api/repos/$r/secrets \
Authorization:"Bearer $DRONE_TOKEN" \
name="docker_password" \
data="$docker_password" \
pull_request:=false
done

52
.local/bin/update-drone-slack Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
DRONE_SERVER=${DRONE_SERVER:="https://ci.makerforce.io"}
DRONE_TOKEN=${DRONE_TOKEN:=""}
echo
echo "This script updates Slack webhooks on all Drone repos"
echo
path_to_httpie=$(which http)
if [ ! -x "$path_to_httpie" ] ; then
echo "HTTPie not installed. Please install it at (https://httpie.org/doc#installation)"
fi
path_to_jq=$(which jq)
if [ ! -x "$path_to_jq" ] ; then
echo "JQ not installed. Please install it at (https://stedolan.github.io/jq/download/)"
fi
if [ -z $DRONE_TOKEN ]; then
echo "Enter Drone token ($DRONE_SERVER/account/token)"
echo -n "> "
read DRONE_TOKEN
echo
fi
echo "Enter Slack webhook URL"
echo -n "> "
read slack_webhook
echo
echo
echo "Fetching repo list..."
repo_list=$(http GET $DRONE_SERVER/api/user/repos Authorization:"Bearer $DRONE_TOKEN" | jq .[].slug -r)
for r in $repo_list; do
echo "Updating slack_webhook in $r..."
http --check-status -b PATCH \
$DRONE_SERVER/api/repos/$r/secrets/slack_webhook \
Authorization:"Bearer $DRONE_TOKEN" \
data="$slack_webhook" \
pull_request:=false \
|| http --check-status -b POST \
$DRONE_SERVER/api/repos/$r/secrets \
Authorization:"Bearer $DRONE_TOKEN" \
name="slack_webhook" \
data="$slack_webhook" \
pull_request:=false
done

View File

@ -0,0 +1,3 @@
#!/bin/sh
# TODO: https://git.makerforce.io/api/swagger#/repository/repoMirrorSync

View File

@ -1,48 +1,17 @@
Host github.com
Hostname ssh.github.com
User git
Port 443
Host goldenbarrel-dot
Hostname 27.104.131.21
User ambrose
Port 80
LocalForward 1853 1.1.1.1:853
LocalForward 2853 1.0.0.1:853
Host goldenbarrel-sit-poly
Hostname 27.104.131.21
User ambrose
Port 80
Host goldenbarrel-wan-test
Hostname makerforce.io
User ambrose
Port 2222
DynamicForward 8000
LocalForward 8080 localhost:8080
RemoteForward 8180 localhost:8180
#Host goldenbarrel-wan-gpg
# Hostname makerforce.io
# User ambrose
# Port 2222
# RemoteForward /home/ambrose/.gnupg/S.gpg-agent /Users/ambrose/.gnupg/S.gpg-agent.extra
# RemoteForward /home/ambrose/.gnupg/S.gpg-agent.ssh /Users/ambrose/.gnupg/S.gpg-agent.ssh
Host goldenbarrel-wan
Hostname makerforce.io
User ambrose
Port 2222
Host goldenbarrel
Hostname goldenbarrel.cacti.makerforce.io
User ambrose
Port 2222
Port 22
Host saguaro
Hostname saguaro.cacti.makerforce.io
User root
Port 222
Port 22
Host raspi
Hostname raspi.cacti.makerforce.io