Skip to content

Commit ef6b000

Browse files
PhilippHeuerPhilipp Heuer
authored andcommitted
feature: initial commit
0 parents  commit ef6b000

6 files changed

Lines changed: 211 additions & 0 deletions

File tree

.gitattributes

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
##
2+
# Handle line endings automatically for files detected as text
3+
##
4+
* text=auto
5+
6+
##
7+
# The above will handle all files NOT found below
8+
##
9+
10+
# These files are text and should be normalized (Convert crlf => lf)
11+
.gitignore text
12+
.gitattributes text
13+
*.adoc text
14+
*.textile text
15+
*.mustache text
16+
*.csv text
17+
*.tab text
18+
*.tsv text
19+
*.sql text
20+
*.md text
21+
*.css text
22+
*.df text
23+
*.htm text
24+
*.html text
25+
*.java text
26+
*.js text
27+
*.json text
28+
*.jsp text
29+
*.jspf text
30+
*.jspx text
31+
*.properties text
32+
*.sh text
33+
*.tld text
34+
*.txt text
35+
*.tag text
36+
*.tagx text
37+
*.xml text
38+
*.yml text
39+
40+
# These files are binary and should be left untouched (binary is a macro for -text -diff)
41+
*.class binary
42+
*.dll binary
43+
*.ear binary
44+
*.gif binary
45+
*.ico binary
46+
*.jar binary
47+
*.jpg binary
48+
*.jpeg binary
49+
*.png binary
50+
*.so binary
51+
*.war binary
52+
53+
# Documents
54+
*.doc diff=astextplain
55+
*.docx diff=astextplain
56+
*.dot diff=astextplain
57+
*.pdf diff=astextplain
58+
*.rtf diff=astextplain
59+
60+
# Linux
61+
*.sh text eol=lf
62+
*.bash text eol=lf
63+
64+
# Visual Studio
65+
*.sln text eol=crlf
66+
*.csproj text eol=crlf
67+
*.vbproj text eol=crlf
68+
*.vcxproj text eol=crlf
69+
*.vcproj text eol=crlf
70+
*.dbproj text eol=crlf
71+
*.fsproj text eol=crlf
72+
*.lsproj text eol=crlf
73+
*.wixproj text eol=crlf
74+
*.modelproj text eol=crlf
75+
*.sqlproj text eol=crlf
76+
*.wmaproj text eol=crlf
77+
*.xproj text eol=crlf
78+
*.props text eol=crlf
79+
*.filters text eol=crlf
80+
*.vcxitems text eol=crlf
81+
82+
# Language specific diff implementation # https://github.com/git/git/blob/master/userdiff.c #
83+
84+
# HTML
85+
*.htm diff=html
86+
*.html diff=html
87+
88+
# Java
89+
*.htm diff=java
90+
91+
# Objective-C
92+
*.c diff=objc
93+
94+
# Perl
95+
*.pl diff=perl
96+
97+
# PHP
98+
*.php diff=php
99+
*.php4 diff=php
100+
*.php5 diff=php
101+
*.php7 diff=php
102+
103+
# Python
104+
*.py diff=python
105+
*.py2 diff=python
106+
*.py3 diff=python
107+
108+
# Ruby
109+
*.rb diff=ruby
110+
111+
# Bibtex
112+
*.bibtex diff=bibtex
113+
114+
# Tex
115+
*.tex diff=tex
116+
117+
# CPP
118+
*.h diff=cpp
119+
*.cpp diff=cpp
120+
121+
# C-Sharp
122+
*.cs diff=csharp
123+
124+
# CSS
125+
*.css diff=css

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
############################################################
2+
# Dockerfile
3+
############################################################
4+
5+
# Set the base image
6+
FROM frolvlad/alpine-glibc:latest
7+
8+
############################################################
9+
# Configuration
10+
############################################################
11+
ENV VERSION "3.10.0"
12+
ENV VERSION_TAG_SHA "dd10d17"
13+
14+
############################################################
15+
# Entrypoint
16+
############################################################
17+
COPY docker-entrypoint.sh /usr/local/bin/
18+
19+
############################################################
20+
# Installation
21+
############################################################
22+
23+
RUN apk --no-cache add bash tar gzip curl ca-certificates gettext &&\
24+
curl -L -o /tmp/oc.tar.gz https://github.com/openshift/origin/releases/download/v${VERSION}/openshift-origin-client-tools-v${VERSION}-${VERSION_TAG_SHA}-linux-64bit.tar.gz &&\
25+
tar xzvf /tmp/oc.tar.gz -C /tmp/ &&\
26+
mv /tmp/openshift-origin-client-tools-v${VERSION}-${VERSION_TAG_SHA}-linux-64bit/oc /usr/local/bin &&\
27+
rm -rf /tmp/oc.tar.gz /tmp/openshift-origin-client-tools-v${VERSION}-${VERSION_TAG_SHA}-linux-64bit &&\
28+
chmod +x /usr/local/bin/oc &&\
29+
chmod +x /usr/local/bin/docker-entrypoint.sh &&\
30+
apk del tar gzip
31+
32+
############################################################
33+
# Execution
34+
############################################################
35+
ENTRYPOINT [ "docker-entrypoint.sh" ]
36+
CMD [ "oc", "--help"]

LICENSE

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) 2018 Philipp Heuer
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.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# OpenShift CLI
2+
3+
This Openshift command line tool docker image ships oc and includes gettext so you can use envsubst to substitute environment variables in your CI/CD pipeline, for example using in Jenkins or a job in GitLab CI .gitlab-ci.yml file.
4+
5+
## Features
6+
7+
Get a valid KubeCTL Config based on the env variable `OC_SERVER` as well as `OC_USERNAME` and `OC_PASSWORD` or with the token as `OC_TOKEN`.

docker-entrypoint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# make sure the required directory exists
5+
mkdir -p /root/.kube
6+
7+
# authByToken
8+
if [ -n "$OC_TOKEN" ]; then
9+
oc login $OC_SERVER --token $OC_TOKEN --insecure-skip-tls-verify
10+
fi
11+
# authByUsername
12+
if [ -n "$OC_USERNAME" ]; then
13+
oc login $OC_SERVER -u $OC_USERNAME -p $OC_PASSWORD --insecure-skip-tls-verify
14+
fi
15+
16+
# real entrypoint
17+
exec "$@"

updater.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Upstream Repository
2+
---
3+
repositoryNamespace: openshift
4+
repositoryName: origin
5+
pattern: "(master|develop|v(?<VERSION>[0-9]+.[0-9]+.[0-9]+))"

0 commit comments

Comments
 (0)