Skip to content

Commit ae5f4b9

Browse files
committed
Implement Docker container github action
1 parent f48ff0f commit ae5f4b9

5 files changed

Lines changed: 77 additions & 0 deletions

File tree

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Container image that runs your code
2+
FROM ubuntu
3+
4+
# Install helper packages
5+
RUN apt-get update \
6+
&& apt-get -y autoremove \
7+
&& apt-get clean \
8+
&& apt-get install -y -qq wget zip unzip \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Download codemaker cli
12+
RUN wget https://github.com/codemakerai/codemaker-cli/releases/download/v0.0.12/linux-amd64.zip -P / \
13+
&& unzip /linux-amd64.zip
14+
15+
# Add codemaker cli tp PATH
16+
ENV PATH="$PATH:/linux-amd64/bin"
17+
18+
# Copies your code file from your action repository to the filesystem path `/` of the container
19+
COPY entrypoint.sh /entrypoint.sh
20+
21+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
22+
ENTRYPOINT ["/entrypoint.sh"]

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 CodeMaker AI Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NOTICE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CodeMaker CLI
2+
Copyright 2023 CodeMaker AI Inc. All Rights Reserved.

action.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# action.yml
2+
name: 'CodeMaker'
3+
description: 'Run CodeMaker code generation'
4+
inputs:
5+
api-key:
6+
description: 'CodeMaker api key'
7+
required: true
8+
mode:
9+
description: 'Code generation mode. Currently we support code, docs or unit-tests'
10+
required: true
11+
default: 'code'
12+
path:
13+
description: 'Path of the file to process'
14+
required: true
15+
runs:
16+
using: 'docker'
17+
image: 'Dockerfile'
18+
args:
19+
- ${{ inputs.api-key }}
20+
- ${{ inputs.mode }}
21+
- ${{ inputs.path }}

entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
api_key=$1
4+
mode=$2
5+
path=$3
6+
7+
# configure codemaker cli
8+
printf $api_key | codemaker configure
9+
10+
# run generation
11+
codemaker generate $mode $path

0 commit comments

Comments
 (0)