Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Ackermann committed Nov 18, 2019
0 parents commit 7e6273e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test CF CLI Action

on:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-18.04
steps:
- uses: citizen-of-planet-earth/cf-cli-action@master
with:
cf_api: ${{ secrets.CF_API }}
cf_username: ${{ secrets.CF_USER }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: ${{ secrets.CF_ORG }}
cf_space: ${{ secrets.CF_SPACE }}
command: target
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:18.04

RUN echo "deb [trusted=yes] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
RUN sudo apt-get update
RUN sudo apt-get install cf-cli

ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Empty file added README.md
Empty file.
29 changes: 29 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "CF CLI"
description: "Deploy and manage Cloud Foundry using the cf cli"
branding:
icon: "upload-cloud"
color: "blue"
inputs:
cf_api:
description: "Target API Endpoint of Cloud Foundry"
required: true
cf_username:
description: "Username for API authentication"
required: true
cf_password:
description: "Password for API authentication"
required: true
cf_org:
description: "Target Organization"
required: false
cf_space:
description: "Target Space"
required: false
command:
description: "Command to run using CF CLI"
required: true
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.command }}
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -l

cf api "$CF_API"
cf auth "$CF_USERNAME" "$CF_PASSWORD"

if [ -n "$CF_ORG" ] && [ -n "$CF_SPACE" ]; then
cf target -o "$CF_ORG" -s "$CF_SPACE"
fi

sh -c "cf $*"

0 comments on commit 7e6273e

Please sign in to comment.