Skip to content

Commit

Permalink
Merge pull request #1753 from jstrachan/boot-image-custom-job
Browse files Browse the repository at this point in the history
fix: upgrade jx and use new boot image
  • Loading branch information
jstrachan authored Nov 16, 2020
2 parents ef0f287 + 11ba41e commit e425566
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .lighthouse/jenkins-x/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
secretKeyRef:
key: password
name: $(params.BDD_GIT_TOKEN_SECRET)
image: gcr.io/jenkinsxio/jx-cli:latest
image: gcr.io/jenkinsxio/jx-cli:3.0.734
name: runci
resources: {}
script: |
Expand Down
2 changes: 1 addition & 1 deletion docker/gcr.io/jenkinsxio/jx-cli.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 3.0.727
version: 3.0.734
101 changes: 101 additions & 0 deletions git-operator/job-gsm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apiVersion: batch/v1
kind: Job
metadata:
labels:
app: jx-boot
jenkins-x.io/kind: jx-git-operator
spec:
backoffLimit: 4
completions: 1
parallelism: 1
template:
metadata:
labels:
app: jx-boot
jenkins-x.io/kind: jx-git-operator
spec:
initContainers:
- args:
- '-c'
- 'mkdir -p $HOME; git config --global --add user.name $GIT_AUTHOR_NAME; git
config --global --add user.email $GIT_AUTHOR_EMAIL; git config --global
credential.helper store; git clone https://${GIT_USER}:${GIT_TOKEN}@${GIT_URL#"https://"} ${GIT_SUB_DIR}; echo cloned
url: $(inputs.params.url) to dir: ${GIT_SUB_DIR}; cd ${GIT_SUB_DIR}; git
checkout ${GIT_REVISION}; echo checked out revision: ${GIT_REVISION} to
dir: ${GIT_SUB_DIR}'
command:
- /bin/sh
env:
- name: GIT_URL
valueFrom:
secretKeyRef:
key: url
name: jx-boot
- name: GIT_USER
valueFrom:
secretKeyRef:
key: username
name: jx-boot
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
key: password
name: jx-boot
- name: GIT_REVISION
value: master
- name: GIT_SUB_DIR
value: source
- name: GIT_AUTHOR_EMAIL
value: [email protected]
- name: GIT_AUTHOR_NAME
value: jenkins-x-labs-bot
- name: GIT_COMMITTER_EMAIL
value: [email protected]
- name: GIT_COMMITTER_NAME
value: jenkins-x-labs-bot
- name: XDG_CONFIG_HOME
value: /workspace/xdg_config
image: gcr.io/jenkinsxio/jx-boot:3.0.734
name: git-clone
volumeMounts:
- mountPath: /workspace
name: workspace-volume
workingDir: /workspace
containers:
- args:
- apply
command:
- make
env:
- name: JX_SECRET_SIDECAR
value: gsm
- name: JX_SECRET_TMP_DIR
value: /workspace/source/.jx-secrets
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
image: gcr.io/jenkinsxio/jx-boot:3.0.734
imagePullPolicy: Always
name: job
volumeMounts:
- mountPath: /workspace
name: workspace-volume
workingDir: /workspace/source
- command:
- versionStream/src/wait-for-complete.sh
image: google/cloud-sdk:slim
imagePullPolicy: Always
name: gsm
volumeMounts:
- mountPath: /workspace
name: workspace-volume
workingDir: /workspace/source
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
serviceAccountName: jx-boot-job
terminationGracePeriodSeconds: 30
volumes:
- name: workspace-volume
emptyDir: {}
83 changes: 83 additions & 0 deletions git-operator/job-vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: batch/v1
kind: Job
metadata:
labels:
app: jx-boot
jenkins-x.io/kind: jx-git-operator
spec:
backoffLimit: 4
completions: 1
parallelism: 1
template:
metadata:
labels:
app: jx-boot
jenkins-x.io/kind: jx-git-operator
spec:
initContainers:
- args:
- '-c'
- 'mkdir -p $HOME; git config --global --add user.name $GIT_AUTHOR_NAME; git
config --global --add user.email $GIT_AUTHOR_EMAIL; git config --global
credential.helper store; git clone https://${GIT_USER}:${GIT_TOKEN}@${GIT_URL#"https://"} ${GIT_SUB_DIR}; echo cloned
url: $(inputs.params.url) to dir: ${GIT_SUB_DIR}; cd ${GIT_SUB_DIR}; git
checkout ${GIT_REVISION}; echo checked out revision: ${GIT_REVISION} to
dir: ${GIT_SUB_DIR}'
command:
- /bin/sh
env:
- name: GIT_URL
valueFrom:
secretKeyRef:
key: url
name: jx-boot
- name: GIT_USER
valueFrom:
secretKeyRef:
key: username
name: jx-boot
- name: GIT_TOKEN
valueFrom:
secretKeyRef:
key: password
name: jx-boot
- name: GIT_REVISION
value: master
- name: GIT_SUB_DIR
value: source
- name: GIT_AUTHOR_EMAIL
value: [email protected]
- name: GIT_AUTHOR_NAME
value: jenkins-x-labs-bot
- name: GIT_COMMITTER_EMAIL
value: [email protected]
- name: GIT_COMMITTER_NAME
value: jenkins-x-labs-bot
- name: XDG_CONFIG_HOME
value: /workspace/xdg_config
image: gcr.io/jenkinsxio/jx-boot:3.0.734
name: git-clone
volumeMounts:
- mountPath: /workspace
name: workspace-volume
workingDir: /workspace
containers:
- args:
- apply
command:
- make
image: gcr.io/jenkinsxio/jx-boot:3.0.734
imagePullPolicy: Always
name: job
volumeMounts:
- mountPath: /workspace
name: workspace-volume
workingDir: /workspace/source
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
serviceAccountName: jx-boot-job
terminationGracePeriodSeconds: 30
volumes:
- name: workspace-volume
emptyDir: {}
4 changes: 2 additions & 2 deletions git-operator/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
value: jenkins-x-labs-bot
- name: XDG_CONFIG_HOME
value: /workspace/xdg_config
image: gcr.io/jenkinsxio/jx-cli:3.0.727
image: gcr.io/jenkinsxio/jx-boot:3.0.734
name: git-clone
volumeMounts:
- mountPath: /workspace
Expand All @@ -66,7 +66,7 @@ spec:
- apply
command:
- make
image: gcr.io/jenkinsxio/jx-cli:3.0.727
image: gcr.io/jenkinsxio/jx-boot:3.0.734
imagePullPolicy: Always
name: job
volumeMounts:
Expand Down
7 changes: 6 additions & 1 deletion src/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ regen-phase-2: verify-ingress-ignore all verify-ignore secrets-populate commit
regen-phase-3: push secrets-wait

.PHONY: apply
apply: regen-check kubectl-apply verify
apply: regen-check kubectl-apply verify write-completed

.PHONY: write-completed
write-completed:
echo completed > jx-boot-completed.txt
echo wrote completed file

.PHONY: kubectl-apply
kubectl-apply:
Expand Down
8 changes: 8 additions & 0 deletions src/wait-for-complete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

echo "waiting for completed file: jx-boot-completed.txt"

while [ ! -f jx-boot-completed.txt ]; do sleep 1; done

echo "completed"

0 comments on commit e425566

Please sign in to comment.