This commit is contained in:
parent
738a505339
commit
e4978976a7
30
.woodpecker.yml
Normal file
30
.woodpecker.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
pipeline:
|
||||||
|
build-only:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: harbor_username
|
||||||
|
password:
|
||||||
|
from_secret: harbor_password
|
||||||
|
repo: harbor.sebclem.fr/${CI_REPO}
|
||||||
|
cache_from: harbor.sebclem.fr/${CI_REPO}
|
||||||
|
registry: harbor.sebclem.fr
|
||||||
|
dry_run: true
|
||||||
|
tags: latest
|
||||||
|
when:
|
||||||
|
event: [push, pull_request, manual]
|
||||||
|
|
||||||
|
build-and-push:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: harbor_username
|
||||||
|
password:
|
||||||
|
from_secret: harbor_password
|
||||||
|
repo: harbor.sebclem.fr/${CI_REPO}
|
||||||
|
cache_from: harbor.sebclem.fr/${CI_REPO}
|
||||||
|
registry: harbor.sebclem.fr
|
||||||
|
tags: latest
|
||||||
|
when:
|
||||||
|
environment: production
|
||||||
|
event: deployment
|
12
entrypoint
12
entrypoint
@ -9,12 +9,12 @@ run_command(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [[ -z "$PLUGIN_PLAYBOOK" ]]; then
|
if [ -z "$PLUGIN_PLAYBOOK" ]; then
|
||||||
echo -e "⚠️ \e[31m'playbook' setting not defined, ABORT!\e[39m"
|
echo -e "⚠️ \e[31m'playbook' setting not defined, ABORT!\e[39m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$PLUGIN_PRIVATE_KEY" ]]; then
|
if [ -z "$PLUGIN_PRIVATE_KEY" ]; then
|
||||||
echo -e "⚠️ \e[31m[WARN] 'private_key' setting not defined !\e[39m"
|
echo -e "⚠️ \e[31m[WARN] 'private_key' setting not defined !\e[39m"
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ fi
|
|||||||
|
|
||||||
args=("$PLUGIN_PLAYBOOK")
|
args=("$PLUGIN_PLAYBOOK")
|
||||||
|
|
||||||
if [[ -n "$PLUGIN_VAULT_TOKEN" ]]; then
|
if [ -n "$PLUGIN_VAULT_TOKEN" ]; then
|
||||||
echo "💼 Adding vault token to 'credentials/vault_token'"
|
echo "💼 Adding vault token to 'credentials/vault_token'"
|
||||||
run_command "mkdir credentials"
|
run_command "mkdir credentials"
|
||||||
echo "$PLUGIN_VAULT_TOKEN" > credentials/vault_token
|
echo "$PLUGIN_VAULT_TOKEN" > credentials/vault_token
|
||||||
@ -33,12 +33,14 @@ if [[ -n "$PLUGIN_VAULT_TOKEN" ]]; then
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "ansible-ci.cfg" ]]; then
|
if [ -f "ansible-ci.cfg" ]; then
|
||||||
|
echo "⚙️ ansible-ci.cfg is present, using it."
|
||||||
rm ansible.cfg
|
rm ansible.cfg
|
||||||
mv ansible-ci.cfg ansible.cfg
|
mv ansible-ci.cfg ansible.cfg
|
||||||
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$PLUGIN_GALAXY_FILE" ]]; then
|
if [ -n "$PLUGIN_GALAXY_FILE" ]; then
|
||||||
echo "🚀 Installing Galaxy dependencies ($PLUGIN_GALAXY_FILE)"
|
echo "🚀 Installing Galaxy dependencies ($PLUGIN_GALAXY_FILE)"
|
||||||
run_command "ansible-galaxy install -r $PLUGIN_GALAXY_FILE --force"
|
run_command "ansible-galaxy install -r $PLUGIN_GALAXY_FILE --force"
|
||||||
echo ""
|
echo ""
|
||||||
|
Loading…
Reference in New Issue
Block a user