Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Added script pre_deploy and github issues templates (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzabellaRaulin authored Aug 29, 2017
1 parent 1d49fe7 commit 0118a2b
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
Thanks for filing an issue! Before hitting the button, give this a read.
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
If you suspect your issue is a bug, please add as much context as you can using the template below. If it is not a bug, remove any sections you don't need and explain how we can help.
As a basic rule, if you cannot provide enough information to continue addressing the issue within 7 days, a maintainer will close it. We will, however, reopen it if you later provide the information. Thanks again.
-->

**Snap daemon version** (use `snapteld -v`):

**Environment**:
- **Cloud provider or hardware configuration**:
- **OS** (e.g. from /etc/os-release):
- **Kernel** (e.g. `uname -a`):
- **Relevant tools** (e.g. plugins used with Snap):
- **Others** (e.g. deploying with Ansible):


**What happened**:


**What you expected to happen**:


**Steps to reproduce it** (as minimally and precisely as possible):

1.
2.
3.


**Anything else do we need to know** (e.g. issue happens only occasionally):
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"
Please provide the following information:
-->
Fixes #

Summary of changes:
-
-
-

How to verify it:
-

Testing done:
-

A picture of a snapping turtle (not required but encouraged):
-
80 changes: 80 additions & 0 deletions scripts/pre_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env bash
# File managed by pluginsync

# http://www.apache.org/licenses/LICENSE-2.0.txt
#
#
# Copyright 2016 Intel Corporation
#
# 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
set -u
set -o pipefail

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__proj_dir="$(dirname "$__dir")"

# shellcheck source=scripts/common.sh
. "${__dir}/common.sh"

build_path="${__proj_dir}/build"
_info "build_path: ${build_path}"
_debug "$(find "${build_path}")"

plugin_name="${__proj_dir##*/}"
git_sha=$(git log --pretty=format:"%H" -1)
s3_path="${__proj_dir}/s3/${plugin_name}"

set +u
if [ -z "$TRAVIS_TAG" ]; then
set -u
git_path="${s3_path}/${git_sha}"
latest_path="${s3_path}/latest_build"
mkdir -p "${git_path}"
mkdir -p "${latest_path}"

_info "copying plugin binaries to ${git_path}"
cp -rp "${build_path}/"* "${git_path}"
_info "copying plugin binaries to ${latest_path}"
cp -rp "${build_path}/"* "${latest_path}"
else
set -u
tag_path="${s3_path}/${TRAVIS_TAG}"
latest_path="${s3_path}/latest"
mkdir -p "${tag_path}"
mkdir -p "${latest_path}"

_info "copying plugin binaries to ${tag_path}"
cp -rp "${build_path}/"* "${tag_path}"
_info "copying plugin binaries to ${latest_path}"
cp -rp "${build_path}/"* "${latest_path}"
fi

release_path="${SNAP_PATH:-"${__proj_dir}/release"}"
mkdir -p "${release_path}"

_info "moving plugin binaries to ${release_path}"

for file in "${build_path}"/**/*/snap-* ; do
filename="${file##*/}"
parent="${file%/*}"
arch="${parent##*/}"
parent="${parent%/*}"
os="${parent##*/}"
cp "${file}" "${release_path}/${filename}_${os}_${arch}"
done

_debug "$(find "${build_path}")"
_debug "$(find "${s3_path}")"
_debug "$(find "${release_path}")"

0 comments on commit 0118a2b

Please sign in to comment.