From 688e5cef12666ca014aebd3c79f609d207ed18d7 Mon Sep 17 00:00:00 2001 From: Zach Marano Date: Tue, 5 May 2020 15:58:06 -0700 Subject: Remove unused workflows. (#894) --- daisy_workflows/README.md | 28 -------- daisy_workflows/build_deb_packages.sh | 70 ------------------- daisy_workflows/build_debian.wf.json | 65 ------------------ daisy_workflows/build_el.wf.json | 122 ---------------------------------- daisy_workflows/build_el_packages.sh | 65 ------------------ 5 files changed, 350 deletions(-) delete mode 100644 daisy_workflows/README.md delete mode 100755 daisy_workflows/build_deb_packages.sh delete mode 100644 daisy_workflows/build_debian.wf.json delete mode 100644 daisy_workflows/build_el.wf.json delete mode 100755 daisy_workflows/build_el_packages.sh diff --git a/daisy_workflows/README.md b/daisy_workflows/README.md deleted file mode 100644 index 54ea5a9..0000000 --- a/daisy_workflows/README.md +++ /dev/null @@ -1,28 +0,0 @@ -## Daisy Workflows for building packages. - -For more information on Daisy and how workflows work, refer to the -[Daisy documentation](https://github.com/GoogleCloudPlatform/compute-image-tools/tree/master/daisy). - -# Workflow invocation - -```shell -# Builds Debian packages from the development branch. -./daisy -project YOUR_PROJECT \ - -zone ZONE \ - -var:github_branch=development \ - -var:output_path=YOUR_GS_BUCKET \ - build_debian.wf.json - -# Builds EL packages. -./daisy -project YOUR_PROJECT \ - -zone ZONE \ - -var:output_path=YOUR_GS_BUCKET \ - build_el.wf.json - -``` - -# Variables - -* `output_path` Specify a different GCS path to save resulting packages to. -* `github_repo` Specify a different github repo (for example a forked repo). -* `github_branch` Specify a different github branch. diff --git a/daisy_workflows/build_deb_packages.sh b/daisy_workflows/build_deb_packages.sh deleted file mode 100755 index 55ee9ae..0000000 --- a/daisy_workflows/build_deb_packages.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. All Rights Reserved. -# -# 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. - -set -e - -URL="http://metadata/computeMetadata/v1/instance/attributes" - -BRANCH="$(curl -f -H Metadata-Flavor:Google ${URL}/github_branch)" -GIT_REPO="$(curl -f -H Metadata-Flavor:Google ${URL}/github_repo)" -OUTPUT="$(curl -f -H Metadata-Flavor:Google ${URL}/output_path)" - -if [ -z $OUTPUT ]; then - OUTPUT="$(curl -f -H Metadata-Flavor:Google ${URL}/daisy-outs-path)" -fi - -if [[ ! -e /etc/debian_version ]]; then - echo "BuildFailed: not a debian host!" - exit 1 -fi - -workdir=$(pwd) -mkdir output - -apt-get update -apt-get install -y git - -# Clone the github repo. -git clone ${GIT_REPO} -b ${BRANCH} compute-image-packages -if [ $? -ne 0 ]; then - echo "BuildFailed: Unable to clone github repo ${GIT_REPO} and branch ${BRANCH}" - exit 1 -fi - -# Build packages. -cd compute-image-packages/packages -for package in *; do - [[ -d "${package}/packaging" ]] || continue - pushd "$package" - ./packaging/setup_deb.sh - if [[ $? -ne 0 ]]; then - echo "BuildFailed: Unable to build $package" - exit 1 - fi - find /tmp/debpackage \( -iname '*.deb' -o -iname '*.dsc' \) \ - -exec mv '{}' "${workdir}/output/" \; - popd -done - -# Copy the deb and dsc files to the output. -cd "${workdir}/output" -gsutil cp *.dsc *.deb ${OUTPUT} - -if [ $? -ne 0 ]; then - echo "BuildFailed: copying to ${OUTPUT} failed." - exit 1 -fi - -echo "BuildSuccess: Packages are in ${OUTPUT}." diff --git a/daisy_workflows/build_debian.wf.json b/daisy_workflows/build_debian.wf.json deleted file mode 100644 index ad4f52b..0000000 --- a/daisy_workflows/build_debian.wf.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "Name": "build-debian-packages", - "Vars": { - "output_path": { - "Description": "GCS output path for packages." - }, - "github_repo": { - "Value": "https://github.com/GoogleCloudPlatform/compute-image-packages.git", - "Description": "Github repo to build packages from." - }, - "github_branch": { - "Value": "master", - "Description": "Github branch to build packages from." - } - }, - "Sources": { - "build_deb_packages.sh": "./build_deb_packages.sh" - }, - "Steps": { - "setup-disk": { - "CreateDisks": [ - { - "Name": "disk-deb9-build", - "SourceImage": "projects/debian-cloud/global/images/family/debian-9", - "SizeGb": "10", - "Type": "pd-ssd" - } - ] - }, - "package-build": { - "CreateInstances": [ - { - "Name": "inst-deb9-build", - "Disks": [ - {"Source": "disk-deb9-build"} - ], - "MachineType": "n1-standard-2", - "Metadata": { - "github_branch": "${github_branch}", - "github_repo": "${github_repo}", - "output_path": "${output_path}" - }, - "Scopes": ["https://www.googleapis.com/auth/devstorage.read_write"], - "StartupScript": "build_deb_packages.sh" - } - ] - }, - "wait-for-build": { - "WaitForInstancesSignal": [ - { - "Name": "inst-deb9-build", - "SerialOutput": { - "Port": 1, - "SuccessMatch": "BuildSuccess:", - "FailureMatch": "BuildFailed:" - } - } - ] - } - }, - "Dependencies": { - "package-build": ["setup-disk"], - "wait-for-build": ["package-build"] - } -} diff --git a/daisy_workflows/build_el.wf.json b/daisy_workflows/build_el.wf.json deleted file mode 100644 index 13303fd..0000000 --- a/daisy_workflows/build_el.wf.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "Name": "build-el-packages", - "Vars": { - "output_path": { - "Value": "${OUTSPATH}", - "Description": "GCS output path for packages." - }, - "github_repo": { - "Value": "https://github.com/GoogleCloudPlatform/compute-image-packages.git", - "Description": "Github repo to build packages from." - }, - "github_branch": { - "Value": "master", - "Description": "Github branch to build packages from." - } - }, - "Sources": { - "build_el_packages.sh": "./build_el_packages.sh" - }, - "Steps": { - "setup-disk": { - "CreateDisks": [ - { - "Name": "disk-el8-build", - "SourceImage": "projects/rhel-cloud/global/images/family/rhel-8", - "SizeGb": "10", - "Type": "pd-ssd" - }, - { - "Name": "disk-el7-build", - "SourceImage": "projects/centos-cloud/global/images/family/centos-7", - "SizeGb": "10", - "Type": "pd-ssd" - }, - { - "Name": "disk-el6-build", - "SourceImage": "projects/centos-cloud/global/images/family/centos-6", - "SizeGb": "10", - "Type": "pd-ssd" - } - ] - }, - "package-build": { - "CreateInstances": [ - { - "Name": "inst-el8-build", - "Disks": [ - {"Source": "disk-el8-build"} - ], - "MachineType": "n1-standard-2", - "Metadata": { - "github_branch": "${github_branch}", - "github_repo": "${github_repo}", - "output_path": "${output_path}" - }, - "Scopes": ["https://www.googleapis.com/auth/devstorage.read_write"], - "StartupScript": "build_el_packages.sh" - }, - { - "Name": "inst-el7-build", - "Disks": [ - {"Source": "disk-el7-build"} - ], - "MachineType": "n1-standard-2", - "Metadata": { - "github_branch": "${github_branch}", - "github_repo": "${github_repo}", - "output_path": "${output_path}" - }, - "Scopes": ["https://www.googleapis.com/auth/devstorage.read_write"], - "StartupScript": "build_el_packages.sh" - }, - { - "Name": "inst-el6-build", - "Disks": [ - {"Source": "disk-el6-build"} - ], - "MachineType": "n1-standard-2", - "Metadata": { - "github_branch": "${github_branch}", - "github_repo": "${github_repo}", - "output_path": "${output_path}" - }, - "Scopes": ["https://www.googleapis.com/auth/devstorage.read_write"], - "StartupScript": "build_el_packages.sh" - } - ] - }, - "wait-for-build": { - "WaitForInstancesSignal": [ - { - "Name": "inst-el8-build", - "SerialOutput": { - "Port": 1, - "SuccessMatch": "BuildSuccess:", - "FailureMatch": "BuildFailed:" - } - }, - { - "Name": "inst-el7-build", - "SerialOutput": { - "Port": 1, - "SuccessMatch": "BuildSuccess:", - "FailureMatch": "BuildFailed:" - } - }, - { - "Name": "inst-el6-build", - "SerialOutput": { - "Port": 1, - "SuccessMatch": "BuildSuccess:", - "FailureMatch": "BuildFailed:" - } - } - ] - } - }, - "Dependencies": { - "package-build": ["setup-disk"], - "wait-for-build": ["package-build"] - } -} diff --git a/daisy_workflows/build_el_packages.sh b/daisy_workflows/build_el_packages.sh deleted file mode 100755 index 264f795..0000000 --- a/daisy_workflows/build_el_packages.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. All Rights Reserved. -# -# 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. - -URL="http://metadata/computeMetadata/v1/instance/attributes" - -BRANCH="$(curl -f -H Metadata-Flavor:Google ${URL}/github_branch)" -GIT_REPO="$(curl -f -H Metadata-Flavor:Google ${URL}/github_repo)" -OUTPUT="$(curl -f -H Metadata-Flavor:Google ${URL}/output_path)" - -if [ -z $OUTPUT ]; then - OUTPUT="$(curl -f -H Metadata-Flavor:Google ${URL}/daisy-outs-path)" -fi - -if [[ ! -e /etc/redhat-release ]]; then - echo "BuildFailed: not a RHEL host!" - exit 1 -fi - -workdir=$(pwd) -mkdir output - -sudo yum install -y git - -# Clone the github repo. -git clone ${GIT_REPO} -b ${BRANCH} compute-image-packages -if [ $? -ne 0 ]; then - echo "BuildFailed: Unable to clone github repo ${GIT_REPO} and branch ${BRANCH}" - exit 1 -fi - -# Build packages. -cd compute-image-packages/packages -for package in *; do - [[ -d "${package}/packaging" ]] || continue - pushd "$package" - ./packaging/setup_rpm.sh - if [[ $? -ne 0 ]]; then - echo "BuildFailed: Unable to build $package" - exit 1 - fi - find /tmp/rpmpackage -iname '*.rpm' -exec mv '{}' "${workdir}/output/" \; - popd -done - -# Copy the rpm files to the output. -cd "${workdir}/output" -gsutil cp *.rpm ${OUTPUT} -if [ $? -ne 0 ]; then - echo "BuildFailed: copying to ${OUTPUT} failed." - exit 1 -fi - -echo "BuildSuccess: Packages are in ${OUTPUT}." -- cgit v1.2.1