Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adostal committed May 24, 2018
1 parent 20de32f commit 24c01f8
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2
jobs:
create_docker_image:
working_directory: ~/docker-image
machine: true
steps:
- checkout
- run:
name: Docker login
command: DOCKER_USER=${JFROG_USER} DOCKER_PASS=${JFROG_PASS} DOCKER_URL=${JFROG_DOCKER_REPO} make docker-login
- run:
name: Set docker image to workspace
command: mkdir -p workspace && echo "${JFROG_DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}" > workspace/docker-image
- run:
name: Show docker image
command: cat workspace/docker-image
- run:
name: Docker create image
command: DOCKER_IMAGE=$(cat workspace/docker-image) DOCKER_VERSION=${CIRCLE_TAG:1} make docker-build
- run:
name: Docker push
command: DOCKER_IMAGE=$(cat workspace/docker-image) make docker-push

workflows:
version: 2
build:
jobs:
- create_docker_image:
context: apitree-aldo-context
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(-.+)?/
branches:
ignore: /.*/
Empty file added .dockerignore
Empty file.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM alpine:latest

LABEL maintainer="Ales Dostal <a.dostal@apitree.cz>"

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY ./src /usr/src/app

ENV HELM_VERSION="v2.9.0"

ENV HELM_URL="https://storage.googleapis.com/kubernetes-helm"
ENV HELM_TARBALL="helm-${HELM_VERSION}-linux-amd64.tar.gz"
ENV STABLE_REPO_URL="https://kubernetes-charts.storage.googleapis.com/"
ENV INCUBATOR_REPO_URL="https://kubernetes-charts-incubator.storage.googleapis.com/"

RUN apk add --update ca-certificates \
&& apk add --update -t deps wget \
&& apk add --update make \
&& wget -q ${HELM_URL}/${HELM_TARBALL} \
&& tar xzfv ${HELM_TARBALL} \
&& mv ./linux-amd64/helm /usr/local/bin \
&& apk del --purge deps \
&& rm /var/cache/apk/* \
&& rm -f ${HELM_TARBALL}
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default: create-docker

# only for local testing
test-build:
@echo "Test docker build"
docker build -t apitree-docker-local.jfrog.io/k8s-helm-jfrog:latest .

# only for local testing
test-go:
docker run -dit apitree-docker-local.jfrog.io/k8s-helm-jfrog:latest

docker-login:
@echo "Login to docker remote repository"
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} ${DOCKER_URL}

docker-build:
@echo "Build docker image"
docker build -t ${DOCKER_IMAGE}:${DOCKER_VERSION} .

docker-push:
@echo "Push to docker repository"
docker push ${DOCKER_IMAGE}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# k8s-helm-jfrog

> Docker image for creating helm package to jfrog
4 changes: 4 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default: test

test:
echo "Hello world"
1 change: 1 addition & 0 deletions src/testfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test file

0 comments on commit 24c01f8

Please sign in to comment.