-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate zulip and ssh keys from build container (#34)
- Loading branch information
Showing
8 changed files
with
279 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Wait for 'done' file to appear | ||
echo "Waiting for the builder to complete" | ||
|
||
cd /scratch | ||
|
||
while true; do | ||
inotifywait -e create -q -q . && [ -f done ] && break | ||
done | ||
echo "Builder completed; uploading" | ||
|
||
# At this point, both 'message' and 'done' files are present | ||
# Read each line from 'done' and store as positional arguments | ||
pubargs=() | ||
while IFS= read -r line; do | ||
pubargs+=("$line") | ||
done < /scratch/done | ||
|
||
echo "Message" | ||
cat /scratch/message | ||
|
||
echo "publish" | ||
cat /scratch/done | ||
|
||
# Then, Run publish.sh with the arguments from the 'done' file | ||
cd /scratch/upload | ||
publish "${pubargs[@]}" | ||
|
||
# Send Zulip message | ||
echo "Uploaded; notifying zulip" | ||
zulip-send --stream committers/notification --subject ig-build \ | ||
--message "$(< /scratch/message)" \ | ||
--user "$ZULIP_EMAIL" \ | ||
--api-key "$ZULIP_API_KEY" \ | ||
--site https://chat.fhir.org | ||
echo "Notified" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
generation: 1 | ||
name: buildk | ||
namespace: fhir | ||
spec: | ||
activeDeadlineSeconds: 36000 | ||
backoffLimit: 6 | ||
completions: 1 | ||
parallelism: 1 | ||
suspend: false | ||
template: | ||
spec: | ||
containers: | ||
- name: ig-upload | ||
image: igbuild | ||
imagePullPolicy: Never | ||
command: ["/usr/local/bin/watch-and-publish"] | ||
args: [] | ||
env: | ||
- name: ZULIP_EMAIL | ||
valueFrom: | ||
secretKeyRef: | ||
key: email | ||
name: zulip-secrets | ||
- name: ZULIP_API_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
key: api_key | ||
name: zulip-secrets | ||
resources: | ||
requests: | ||
memory: 512Mi | ||
volumeMounts: | ||
- name: scratch | ||
mountPath: /scratch | ||
- mountPath: /etc/ci_build_keys | ||
name: keys | ||
- name: ig-build | ||
image: igbuild | ||
imagePullPolicy: Never | ||
env: | ||
- name: PUBLISHER_JAR_URL | ||
value: https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar | ||
- name: TX_SERVER_URL | ||
value: http://tx.fhir.org | ||
- name: DEADLINE_SECONDS | ||
value: "36000" | ||
- name: JAVA_MEMORY | ||
value: 19000m | ||
- name: IG_ORG | ||
value: "HL7" | ||
- name: IG_REPO | ||
value: "smart-app-launch" | ||
- name: IG_BRANCH | ||
value: "master" | ||
resources: | ||
limits: | ||
memory: 30Gi | ||
requests: | ||
memory: 1Gi | ||
volumeMounts: | ||
- name: scratch | ||
mountPath: /scratch | ||
- mountPath: /etc/ig.builder.keyfile.ini | ||
name: fhir-settings | ||
subPath: ig.builder.keyfile.ini | ||
- mountPath: /etc/fhir-settings.json | ||
name: fhir-settings | ||
subPath: fhir-settings.json | ||
restartPolicy: Never | ||
volumes: | ||
- name: scratch | ||
emptyDir: {} | ||
- name: keys | ||
secret: | ||
defaultMode: 256 | ||
secretName: ci-build-keys | ||
- name: fhir-settings | ||
secret: | ||
defaultMode: 256 | ||
secretName: fhir-settings |
Oops, something went wrong.