Create jobs to handle and delete nolabs bookings
[infra/cicd.git] / jjb / nolabs / booking-job-macros.yaml
diff --git a/jjb/nolabs/booking-job-macros.yaml b/jjb/nolabs/booking-job-macros.yaml
new file mode 100644 (file)
index 0000000..4fc20d3
--- /dev/null
@@ -0,0 +1,41 @@
+---
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+- builder:
+    name: 'handlebooking-macro'
+    builders:
+      - shell:
+          !include-raw: ../cloud-infra/wait-for-pkg-manager.sh
+      - shell: |
+          #!/bin/bash
+          cp $OPENRC_FILE /tmp/openrc
+      - shell:
+          !include-raw: ./handle-booking.sh
+
+- builder:
+    name: 'deletebooking-macro'
+    builders:
+      - shell:
+          !include-raw: ../cloud-infra/wait-for-pkg-manager.sh
+      - shell: |
+          #!/bin/bash
+          cp $OPENRC_FILE /tmp/openrc
+      - shell:
+          !include-raw: ./delete-booking.sh