Skip to content

Instantly share code, notes, and snippets.

@imesh
Last active August 29, 2015 14:00
Show Gist options
  • Save imesh/11141822 to your computer and use it in GitHub Desktop.
Save imesh/11141822 to your computer and use it in GitHub Desktop.
Sign stratos packages
#!/bin/bash
# -----------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
# -----------------------------------------------------------------
# Sign stratos packages
# -----------------------------------------------------------------
key_id= # PGP Key ID
stratos_version=4.0.0-incubating
ca_pack=apache-stratos-cartridge-agent-${stratos_version}-bin.zip
cep_ext_pack=apache-stratos-cep-extension-${stratos_version}.zip
cli_pack=apache-stratos-cli-${stratos_version}.zip
hap_ext_pack=apache-stratos-haproxy-extension-${stratos_version}-bin.zip
lb_pack=apache-stratos-load-balancer-${stratos_version}.zip
echo "Generating sha1sum..."
sha1sum apache-stratos-${stratos_version}.zip > apache-stratos-${stratos_version}.zip.sha1
sha1sum ${ca_pack} > ${ca_pack}.sha1
sha1sum ${cep_ext_pack} > ${cep_ext_pack}.sha1
sha1sum ${cli_pack} > ${cli_pack}.sha1
sha1sum ${hap_ext_pack} > ${hap_ext_pack}.sha1
sha1sum ${lb_pack} > ${lb_pack}.sha1
echo "Generating md5sum..."
md5sum apache-stratos-${stratos_version}.zip > apache-stratos-${stratos_version}.zip.md5
md5sum ${ca_pack} > ${ca_pack}.md5
md5sum ${cep_ext_pack} > ${cep_ext_pack}.md5
md5sum ${cli_pack} > ${cli_pack}.md5
md5sum ${hap_ext_pack} > ${hap_ext_pack}.md5
md5sum ${lb_pack} > ${lb_pack}.md5
echo "Signing packages..."
gpg -u ${key_id} --armor --output apache-stratos-${stratos_version}.zip.asc --detach-sig apache-stratos-${stratos_version}.zip
gpg -u ${key_id} --armor --output ${ca_pack}.asc --detach-sig ${ca_pack}
gpg -u ${key_id} --armor --output ${cep_ext_pack}.asc --detach-sig ${cep_ext_pack}
gpg -u ${key_id} --armor --output ${cli_pack}.asc --detach-sig ${cli_pack}
gpg -u ${key_id} --armor --output ${hap_ext_pack}.asc --detach-sig ${hap_ext_pack}
gpg -u ${key_id} --armor --output ${lb_pack}.asc --detach-sig ${lb_pack}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment