Skip to content

Commit 89a886b

Browse files
author
Martin Reynolds
committed
feat: action definition and script initial
1 parent 93e882e commit 89a886b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'jFrog CLI for Artifactory'
2+
description: 'Run jFrog CLI commands for Artifactory'
3+
branding:
4+
icon: 'check'
5+
color: 'green'
6+
runs:
7+
using: 'docker'
8+
image: 'docker://advancedcsg/action-jfrog-cli:master'
9+

entrypoint.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ -z ${CRED+x} ]; then
6+
echo "No credentials specified, ypu may get into errors."
7+
else
8+
echo "Authentication using $CRED";
9+
10+
if [ $CRED == "username" ];
11+
then
12+
sh -c "jfrog rt config --interactive=false --enc-password=true --url=$URL --user=$USER --password=$PASSWORD"
13+
elif [ $CRED == "apikey" ];
14+
then
15+
sh -c "jfrog rt config --interactive=false --enc-password=true --url=$URL --apikey=$APIKEY"
16+
elif [ $CRED == "accesstoken" ];
17+
sh -c "jfrog rt config --interactive=false --enc-password=true --url=$URL --access-token=$ACCESSTOKEN"
18+
else
19+
echo "";
20+
fi
21+
fi
22+
23+
# Capture output
24+
output=$( sh -c "jfrog rt $*" )
25+
26+
# Preserve output for consumption by downstream actions
27+
echo "$output" > "${HOME}/${GITHUB_ACTION}.log"
28+
29+
# Write output to STDOUT
30+
echo "$output"

0 commit comments

Comments
 (0)