Skip to content

Commit b1ea0fd

Browse files
added jo image
1 parent 6f8d42a commit b1ea0fd

File tree

6 files changed

+90
-2
lines changed

6 files changed

+90
-2
lines changed

.github/workflows/jo.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: jo
2+
3+
on:
4+
push:
5+
paths:
6+
- jo/*
7+
- .github/workflows/gatling.yaml
8+
9+
env:
10+
WORKSPACE: jo
11+
DOCKER_REPO: cloudkats
12+
DOCKER_IMAGE: jo
13+
14+
jobs:
15+
buildonpush:
16+
name: BuildOnPush
17+
runs-on: ubuntu-latest
18+
if: github.event_name == 'push'
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Build the Docker image
23+
working-directory: ${{ env.WORKSPACE }}
24+
run: |
25+
echo "Build"
26+
27+
docker build . --file Dockerfile --tag image \
28+
--build-arg VERSION=$(cat version)
29+
30+
- name: Login to Registry
31+
run: |
32+
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin
33+
env:
34+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
35+
DOCKER_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
36+
37+
- name: Push Docker image
38+
working-directory: ${{ env.WORKSPACE }}
39+
run: |
40+
echo "Push"
41+
42+
image_version=$(cat version)
43+
44+
IMAGE_ID="${DOCKER_REPO}/${DOCKER_IMAGE}"
45+
tag_date="$(date +%Y%d%m)"
46+
47+
# Strip git ref prefix from version
48+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
49+
# Strip "v" prefix from tag name
50+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
51+
52+
# Use Docker `latest` tag convention
53+
[ "$VERSION" == "master" ] && VERSION=latest
54+
docker tag image "${IMAGE_ID}:${VERSION}"
55+
docker push "${IMAGE_ID}:${VERSION}"
56+
57+
docker tag image "${IMAGE_ID}:${image_version}.${GITHUB_SHA::8}"
58+
docker push "${IMAGE_ID}:${image_version}.${GITHUB_SHA::8}"
59+
60+
docker tag image "${IMAGE_ID}:${image_version}"
61+
docker push "${IMAGE_ID}:${image_version}"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sandbox
2-
do-not-commit
2+
do-not-commit
3+
spam/

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@
6262
[![](https://github.com/cloudkats/docker-tools/workflows/gatling/badge.svg)](https://github.com/cloudkats/docker-tools/actions?query=workflow%3Agatling)
6363
[![](https://img.shields.io/docker/pulls/cloudkats/gatling?color=green&logo=docker&logoColor=pink&style=flat-square)](https://hub.docker.com/r/cloudkats/gatling)
6464

65+
## Jo
66+
67+
- [Git Repo](https://github.com/jpmens/jo)
68+
69+
[![](https://github.com/cloudkats/docker-tools/workflows/jo/badge.svg)](https://github.com/cloudkats/docker-tools/actions?query=workflow%3Ajo)
70+
[![](https://img.shields.io/docker/pulls/cloudkats/jo?color=green&logo=docker&logoColor=pink&style=flat-square)](https://hub.docker.com/r/cloudkats/jo)
71+
6572
## Create Locally
6673
```
6774
$ cd <Folder>
@@ -92,4 +99,5 @@ Submit a pull request
9299
```sh
93100
docker build . --tag image \
94101
--build-arg VERSION=$(cat version)
95-
```
102+
```
103+

jo/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM alpine:3.11
2+
3+
# enable edge repository
4+
RUN sed -i '/edge/s/^#//' /etc/apk/repositories
5+
RUN echo "@edgecomms http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
6+
7+
ARG VERSION
8+
ENV JO_VERSION $VERSION
9+
10+
# hadolint ignore=DL3018
11+
RUN apk add -Uuv --no-cache bash git make openssl jo@edgecomms==${JO_VERSION}-r0
12+
13+
ENTRYPOINT [ "/bin/bash", "-c"]
14+
CMD ["/bin/bash"]

jo/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# jo
2+
3+
Docker image for https://github.com/jpmens/jo project.

jo/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.3

0 commit comments

Comments
 (0)