websites: move fedora-websites build to openshift
This commit is contained in:
parent
50b3afc7e2
commit
6da87e8900
3 changed files with 89 additions and 0 deletions
|
@ -66,3 +66,22 @@
|
||||||
app: websites
|
app: websites
|
||||||
template: cron-updatepot.yml
|
template: cron-updatepot.yml
|
||||||
objectname: cron-updatepot.yml
|
objectname: cron-updatepot.yml
|
||||||
|
|
||||||
|
- role: openshift/imagestream
|
||||||
|
app: websites
|
||||||
|
imagename: fedora-websites
|
||||||
|
|
||||||
|
- role: openshift/object
|
||||||
|
app: websites
|
||||||
|
template: fedora-websites-bc.yml
|
||||||
|
objectname: fedora-websites-bc.yml
|
||||||
|
|
||||||
|
- role: openshift/start-build
|
||||||
|
app: websites
|
||||||
|
buildname: fedora-websites
|
||||||
|
objectname: fedora-websites
|
||||||
|
|
||||||
|
- role: openshift/object
|
||||||
|
app: websites
|
||||||
|
template: fedora-websites-cron.yml
|
||||||
|
objectname: fedora-websites-cron.yml
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
apiVersion: build.openshift.io/v1
|
||||||
|
kind: BuildConfig
|
||||||
|
metadata:
|
||||||
|
name: fedora-websites
|
||||||
|
spec:
|
||||||
|
successfulBuildsHistoryLimit: 1
|
||||||
|
failedBuildsHistoryLimit: 1
|
||||||
|
runPolicy: Serial
|
||||||
|
source:
|
||||||
|
git:
|
||||||
|
uri: "https://pagure.io/fedora-websites.git"
|
||||||
|
{% if env == 'staging' %}
|
||||||
|
ref: staging
|
||||||
|
{% else %}
|
||||||
|
ref: master
|
||||||
|
{% endif %}
|
||||||
|
strategy:
|
||||||
|
type: Docker
|
||||||
|
dockerStrategy:
|
||||||
|
dockerfilePath: Dockerfile
|
||||||
|
output:
|
||||||
|
to:
|
||||||
|
kind: ImageStreamTag
|
||||||
|
name: fedora-websites:latest
|
|
@ -0,0 +1,46 @@
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: fedora-websites-build
|
||||||
|
spec:
|
||||||
|
concurrencyPolicy: Forbid
|
||||||
|
schedule: "10 * * * *"
|
||||||
|
successfulJobsHistoryLimit: 1
|
||||||
|
failedJobsHistoryLimit: 1
|
||||||
|
activeDeadlineSeconds: 900
|
||||||
|
startingDeadlineSeconds: 300
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
parent: "cronjobbuild"
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: build
|
||||||
|
image: image-registry.openshift-image-registry.svc:5000/websites/fedora-websites:latest
|
||||||
|
command: ["/bin/bash", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
cd /tmp
|
||||||
|
git clone --depth 1 --single-branch https://pagure.io/fedora-websites.git
|
||||||
|
cd fedora-websites
|
||||||
|
|
||||||
|
# build all sites in $OUTPUT
|
||||||
|
./tools/build_all.sh
|
||||||
|
env:
|
||||||
|
- name: BUILD_ENV
|
||||||
|
value: "{{ env_short }}"
|
||||||
|
- name: OUTPUT
|
||||||
|
value: /output
|
||||||
|
volumeMounts:
|
||||||
|
- name: build-output
|
||||||
|
mountPath: /output
|
||||||
|
readOnly: false
|
||||||
|
restartPolicy: Never
|
||||||
|
startingDeadlineSeconds: 600
|
||||||
|
volumes:
|
||||||
|
- name: build-output
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: websites-storage
|
Loading…
Add table
Add a link
Reference in a new issue