Skip to content

Commit

Permalink
Draft create
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Mellard committed Jul 21, 2020
1 parent 253461f commit 2584f07
Show file tree
Hide file tree
Showing 49 changed files with 221 additions and 80 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
draft.toml
target/classes
target/generated-sources
target/generated-test-sources
target/maven-archiver
target/maven-status
target/surefire-reports
target/test-classes
target/*.original
charts/
NOTICE
LICENSE
README.md
27 changes: 27 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
*.png

# known compile time folders
target/
node_modules/
vendor/
6 changes: 6 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
aliases:
- chris-mellard
best-approvers:
- chris-mellard
best-reviewers:
- chris-mellard
2 changes: 1 addition & 1 deletion charts/jx/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ icon: https://jenkins-x.github.io/jenkins-x-website/img/profile.png
sources:
- https://github.com/jenkins-x/jx
maintainers:
- name: Jenkins X Team
name: jx
email: [email protected]
5 changes: 5 additions & 0 deletions charts/preview/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
description: A Helm chart for Kubernetes
icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/master/images/go.png
name: preview
version: 0.1.0-SNAPSHOT
18 changes: 18 additions & 0 deletions charts/preview/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
OS := $(shell uname)

preview:
ifeq ($(OS),Darwin)
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml
sed -i "" -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml
else ifeq ($(OS),Linux)
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/chrismellard\/jx|" values.yaml
sed -i -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml
else
echo "platfrom $(OS) not supported to release from"
exit -1
endif
echo " version: $(PREVIEW_VERSION)" >> requirements.yaml
jx step helm build
16 changes: 16 additions & 0 deletions charts/preview/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# !! File must end with empty line !!
dependencies:
- alias: expose
name: exposecontroller
repository: http://chartmuseum.jenkins-x.io
version: 2.3.92
- alias: cleanup
name: exposecontroller
repository: http://chartmuseum.jenkins-x.io
version: 2.3.92

# !! "alias: preview" must be last entry in dependencies array !!
# !! Place custom dependencies above !!
- alias: preview
name: jx
repository: file://../jx
22 changes: 22 additions & 0 deletions charts/preview/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

expose:
Annotations:
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-delete-policy: hook-succeeded
config:
exposer: Ingress
http: true
tlsacme: false

cleanup:
Args:
- --cleanup
Annotations:
helm.sh/hook: pre-delete
helm.sh/hook-delete-policy: hook-succeeded

preview:
image:
repository:
tag:
pullPolicy: IfNotPresent
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ canary:
host: acme.com

service:
name: REPLACE_ME_APP_NAME
name: jx
type: ClusterIP
externalPort: 80
internalPort: 8080
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/importcmd/import_placehoders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestReplacePlaceholders(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, "/home/jenkins/go/src/github.com/foo/bar/registry-org", string(testFile), "replaced placeholder")

// REPLACE_ME_APP_NAME/REPLACE_ME_APP_NAME.txt
// jx/jx.txt
testDirBar := path.Join(f, "bar")
testFile, err = util.LoadBytes(testDirBar, "bar.txt")
assert.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "7.0.0.RC1"
description: A Helm Chart
name: REPLACE_ME_APP_NAME
name: jx
version: 0.0.1-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "7.0.0.RC1"
description: A Helm Chart
name: REPLACE_ME_APP_NAME
name: jx
version: 0.0.1-SNAPSHOT

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/REPLACE_ME_DOCKER_REGISTRY_ORG
/home/jenkins/go/src/github.com/chrismellard/jx/chrismellard
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/REPLACE_ME_DOCKER_REGISTRY_ORG
/home/jenkins/go/src/github.com/chrismellard/jx/chrismellard
2 changes: 1 addition & 1 deletion pkg/cmd/importcmd/test_data/replace_placeholders/file.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/REPLACE_ME_DOCKER_REGISTRY_ORG
/home/jenkins/go/src/github.com/chrismellard/jx/chrismellard
1 change: 1 addition & 0 deletions pkg/cmd/importcmd/test_data/replace_placeholders/jx/jx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/jenkins/go/src/github.com/chrismellard/jx/chrismellard
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pipeline {
label "jenkins-maven"
}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {{.Agent.Groovy}}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
{{- .Environment}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pipeline {
label "jenkins-go"
}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
Expand All @@ -19,13 +19,13 @@ pipeline {
}
steps {
container('go') {
dir('/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME') {
dir('/home/jenkins/go/src/github.com/chrismellard/jx') {
checkout scm
sh "make linux"
sh "export VERSION=$PREVIEW_VERSION && skaffold build -f skaffold.yaml"
sh "jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION"
}
dir('/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/charts/preview') {
dir('/home/jenkins/go/src/github.com/chrismellard/jx/charts/preview') {
sh "make preview"
sh "jx preview --app $APP_NAME --dir ../.."
}
Expand All @@ -38,7 +38,7 @@ pipeline {
}
steps {
container('go') {
dir('/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME') {
dir('/home/jenkins/go/src/github.com/chrismellard/jx') {
checkout scm

// ensure we're not on a detached head
Expand All @@ -62,7 +62,7 @@ pipeline {
}
steps {
container('go') {
dir('/home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/charts/REPLACE_ME_APP_NAME') {
dir('/home/jenkins/go/src/github.com/chrismellard/jx/charts/jx') {
sh "jx step changelog --version v\$(cat ../../VERSION)"

// release the helm chart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {{.Agent.Groovy}}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
{{- .Environment}}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
agent:
label: jenkins-go
container: go
dir: /home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME
dir: /home/jenkins/go/src/github.com/chrismellard/jx
pipelines:
pullRequest:
setup:
Expand All @@ -13,7 +13,7 @@ pipelines:
release:
setup:
steps:
- groovy: git 'https://REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME.git'
- groovy: git 'https://github.com/chrismellard/jx.git'
when: "prow"
- groovy: checkout scm
when: "!prow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pipelines:
- sh: jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:$PREVIEW_VERSION
promote:
steps:
- dir: /home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/charts/preview
- dir: /home/jenkins/go/src/github.com/chrismellard/jx/charts/preview
steps:
- sh: make preview
- sh: jx preview --app $APP_NAME --dir ../..
Expand All @@ -22,7 +22,7 @@ pipelines:
- sh: jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)
promote:
steps:
- dir: /home/jenkins/go/src/REPLACE_ME_GIT_PROVIDER/REPLACE_ME_ORG/REPLACE_ME_APP_NAME/charts/REPLACE_ME_APP_NAME
- dir: /home/jenkins/go/src/github.com/chrismellard/jx/charts/jx
steps:
- sh: jx step changelog --version v\$(cat ../../VERSION)
- comment: release the helm chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pipeline {
label "jenkins-maven"
}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
Expand Down Expand Up @@ -58,7 +58,7 @@ pipeline {
}
steps {
container('maven') {
dir('./charts/REPLACE_ME_APP_NAME') {
dir('./charts/jx') {
sh "jx step changelog --version v\$(cat ../../VERSION)"

// release the helm chart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {{.Agent.Groovy}}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
{{- .Environment}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipelines:
- sh: jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)
promote:
steps:
- dir: ./charts/REPLACE_ME_APP_NAME
- dir: ./charts/jx
steps:
- sh: jx step changelog --version v\$(cat ../../VERSION)
- comment: release the helm chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pipeline {
label "jenkins-maven"
}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
Expand Down Expand Up @@ -58,7 +58,7 @@ pipeline {
}
steps {
container('maven') {
dir('./charts/REPLACE_ME_APP_NAME') {
dir('./charts/jx') {
sh "jx step changelog --version v\$(cat ../../VERSION)"

// release the helm chart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {{.Agent.Groovy}}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
{{- .Environment}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipelines:
- sh: jx step post build --image $DOCKER_REGISTRY/$ORG/$APP_NAME:\$(cat VERSION)
promote:
steps:
- dir: ./charts/REPLACE_ME_APP_NAME
- dir: ./charts/jx
steps:
- sh: jx step changelog --version v\$(cat ../../VERSION)
- comment: release the helm chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pipeline {
label "jenkins-maven"
}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
}
stages {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {{.Agent.Groovy}}
environment {
ORG = 'REPLACE_ME_ORG'
APP_NAME = 'REPLACE_ME_APP_NAME'
ORG = 'chrismellard'
APP_NAME = 'jx'
CHARTMUSEUM_CREDS = credentials('jenkins-x-chartmuseum')
{{- .Environment}}
}
Expand Down
Loading

0 comments on commit 2584f07

Please sign in to comment.