-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b62c113
Showing
5 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# GitHub recommends pinning actions to a commit SHA. | ||
# To get a newer version, you will need to update the SHA. | ||
# You can also reference a tag or branch, but the action may change without warning. | ||
|
||
name: Create and publish a Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b | ||
# aka docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a | ||
# aka docker/[email protected] | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 | ||
# aka docker/[email protected] | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.wcscfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"cSpell.words": [ | ||
"handsupshop", | ||
"wcscfg", | ||
"wcscmd" | ||
], | ||
"markdown.extension.toc.levels": "2..6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM python:3.11.3-alpine3.17 | ||
|
||
RUN pip install wcs-python3-sdk chardet | ||
|
||
CMD [ "wcscmd" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# docker-wcscmd | ||
|
||
- [Installation](#installation) | ||
- [Getting Started](#getting-started) | ||
- [Create config file](#create-config-file) | ||
- [Setup Configuration](#setup-configuration) | ||
- [Alias Command](#alias-command) | ||
- [Command list](#command-list) | ||
|
||
## Installation | ||
|
||
```shell | ||
docker pull ghcr.io/handsupshop/docker-wcscmd | ||
``` | ||
|
||
## Getting Started | ||
|
||
### Create config file | ||
|
||
```shell | ||
touch "$HOME/.wcscfg" | ||
``` | ||
|
||
### Setup Configuration | ||
|
||
```shell | ||
HOST_CONFIG_FILE="$HOME/.wcscfg" | ||
docker run --rm -it \ | ||
-v "$HOST_CONFIG_FILE:/root/.wcscfg:rw" \ | ||
ghcr.io/handsupshop/docker-wcscmd wcscmd --configure | ||
``` | ||
|
||
### Alias Command | ||
|
||
```shell | ||
alias wcscmd='docker run --rm -it -v "$HOME/.wcscfg:/root/.wcscfg:rw" ghcr.io/handsupshop/docker-wcscmd wcscmd' | ||
``` | ||
|
||
## Command list | ||
|
||
[Wangsu-Cloud-Storage/wcs-python3-sdk](https://github.com/Wangsu-Cloud-Storage/wcs-python3-sdk#wcscmd%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8) |