-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8b5adcf
commit d2dddb1
Showing
5 changed files
with
102 additions
and
1 deletion.
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,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker build branch | ||
run: make docker | ||
if: ${{ github.ref_type == 'branch' && github.ref_name != 'main' }} | ||
|
||
- name: Docker build main | ||
run: make docker_main | ||
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }} | ||
|
||
- name: Docker build tag | ||
run: make docker_tag TAG="${{github.ref_name}}" | ||
if: ${{ github.ref_type == 'tag' }} |
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,34 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
CONTAINER_CODE_DIR=/opt/code | ||
|
||
DOCKER_REGISTRY=index.docker.io/flounderpinto | ||
|
||
DOCKER_REPO=quicktype | ||
DOCKER_BUILD_BRANCH_CMD=dockerBuildStandardBranch -r ${DOCKER_REPO} ${ARGS} | ||
DOCKER_BUILD_MAIN_CMD=dockerBuildStandardMain -r ${DOCKER_REPO} ${ARGS} | ||
DOCKER_BUILD_TAG_CMD=dockerBuildStandardTag ${TAG} -r ${DOCKER_REPO} ${ARGS} | ||
DOCKER_BUILDER_IMAGE=${DOCKER_REGISTRY}/builder-docker-flounderpinto:v0.1.0 | ||
DOCKER_BUILDER_PULL_CMD=docker pull ${DOCKER_BUILDER_IMAGE} | ||
DOCKER_BUILDER_RUN_CMD=${DOCKER_BUILDER_PULL_CMD} && \ | ||
docker run \ | ||
--rm \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v ${HOME}/.docker:/tmp/.docker:ro \ | ||
-v ${ROOT_DIR}:${CONTAINER_CODE_DIR} \ | ||
${DOCKER_BUILDER_IMAGE} | ||
|
||
.PHONY: docker docker_main docker_tag | ||
|
||
docker: | ||
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_BRANCH_CMD} | ||
|
||
docker_main: | ||
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_MAIN_CMD} | ||
|
||
docker_tag: | ||
test ${TAG} | ||
${DOCKER_BUILDER_RUN_CMD} ${DOCKER_BUILD_TAG_CMD} | ||
|
||
#Everything right of the pipe is order-only prerequisites. | ||
all: | docker |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# quicktype-docker | ||
# quicktype-docker | ||
|
||
A docker image of https://github.com/glideapps/quicktype |
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,19 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && \ | ||
apt install -y \ | ||
curl && \ | ||
curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh && \ | ||
chmod 755 /tmp/nodesource_setup.sh && \ | ||
/tmp/nodesource_setup.sh && \ | ||
apt install -y \ | ||
nodejs && \ | ||
npm install -g quicktype && \ | ||
apt remove -y \ | ||
curl && \ | ||
apt autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT ["quicktype"] |
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,17 @@ | ||
#!/bin/bash | ||
|
||
#If this container is run as a user, then home will be set to "/". | ||
# Set the home directory env variable to the home directory created in the Dockerfile. | ||
if [ "${HOME}" = "/" ]; then | ||
export HOME="$USER_HOME" | ||
fi | ||
|
||
#Set the container id of this container. | ||
# Often the short version of this is set in HOSTNAME, | ||
# but when using "--network host", HOSTNAME is set to the hostname of the host, | ||
# so something else is needed. | ||
export CONTAINER_ID=$(basename $(cat /proc/1/cpuset)) | ||
|
||
echo "Running..." | ||
exec "${@}" | ||
echo "...done" |