From 4930375a975c2ad7429c94f7c4fde023b974c8c8 Mon Sep 17 00:00:00 2001 From: Arash Hatami Date: Thu, 22 Dec 2022 22:35:56 +0330 Subject: [PATCH] Add namespace --- README.md | 15 ++++++++------- action.yml | 5 +++++ entrypoint.sh | 3 ++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 68d61b8..da282da 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,14 @@ With this action you can update your deployment on ArvanCloud PaaS. Following inputs can be used as `step.with` keys -| Name | Type | Default | Description | -| ----------- | ------ | ------- | ------------------------------------------------------------------------ | -| `auth` | String | | Your API token from [ArvanCloud](https://www.arvancloud.com/en/docs/api) | -| `app` | String | | Application's name in your PaaS project | -| `container` | String | | The container that you want to update its image | -| `image` | String | | Docker image like `org/image:tag` | -| `version` | String | `1.3.3` | Version of ArvanCloud CLI tool | +| Name | Type | Default | Description | +| ----------- | -------- | ------- | ----------------------------------------------------------------------------------- | +| `auth` | Required | | Your API token from [ArvanCloud](https://www.arvancloud.com/en/docs/api) | +| `namespace` | | | The target namespace ( PaaS project ). Will be the default project if not specified | +| `app` | Required | | Application's name in your PaaS project | +| `container` | Required | | The container that you want to update its image | +| `image` | Required | | Docker image like `org/image:tag` | +| `version` | | `1.3.3` | Version of ArvanCloud CLI tool | ### Authentication diff --git a/action.yml b/action.yml index 9196948..f6b1b90 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: auth: description: "Your ArvanCloud API auth token" required: true + namespace: + description: "The target namespace ( project )" + required: false + default: "" app: description: "The ArvanCloud app to deploy to" required: true @@ -30,3 +34,4 @@ runs: - ${{ inputs.app }} - ${{ inputs.container }} - ${{ inputs.image }} + - ${{ inputs.namespace }} diff --git a/entrypoint.sh b/entrypoint.sh index 0a9471b..7eaad01 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -57,6 +57,7 @@ AUTH="$2" APP="$3" CONTAINER="$4" IMAGE="$5" +NS="$6" echo " -----> Create directory" @@ -72,4 +73,4 @@ echo " -----> Login" echo " -----> Deploy" -/service/arvan paas set image deployment ${APP} ${CONTAINER}=${IMAGE} \ No newline at end of file +/service/arvan paas ${NS} set image deployment ${APP} ${CONTAINER}=${IMAGE} \ No newline at end of file