Skip to content

Commit

Permalink
Fix Issue #3. Fix problem with origin keys needing to be in user acct…
Browse files Browse the repository at this point in the history
… as well as global.
  • Loading branch information
martinhbramwell committed Oct 21, 2016
1 parent 72136bf commit fdbc11f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 11 additions & 1 deletion habitat/BuildAndUpload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function detectIncoherentVersionSemantics() {


function detectMissingHabitatOriginKey() {

sudo hab origin key export ${HABITAT_PKG_ORIGIN} --type public 2>/dev/null || appendToDefectReport "Missing Habitat Origin Key.
A Habitat origin key must be generated or imported.
Eg;
Expand All @@ -248,11 +249,19 @@ cat ${HOME}/.hab/cache/keys/${HABITAT_PKG_ORIGIN}-\${KEY_STAMP}.pub | sudo hab o
cat ${HOME}/.hab/cache/keys/${HABITAT_PKG_ORIGIN}-\${KEY_STAMP}.sig.key | sudo hab origin key import; echo "";
";
# TEMPORARY NOTE: An unresolved issue means that the key must
# TEMPORARY NOTE: An unresolved issue means that the key must be available in ~/.hab/cache/keys as well as in /hab/cache/keys
echo -e "\n";
}


function ensureUserAlsoHasGlobalOriginKey() {

sudo cp /hab/cache/keys/${HABITAT_PKG_ORIGIN}-*.pub ~/.hab/cache/keys;
sudo cp /hab/cache/keys/${HABITAT_PKG_ORIGIN}-*.sig.key ~/.hab/cache/keys;

}




function buildMeteorProjectBundleIfNotExist() {
Expand Down Expand Up @@ -450,6 +459,7 @@ detectIncoherentVersionSemantics;

showDefectReport;

ensureUserAlsoHasGlobalOriginKey;

buildMeteorProjectBundleIfNotExist;

Expand Down
5 changes: 3 additions & 2 deletions habitat/scripts/Update_or_Install_Dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function addHabitatFilesToGit() {
git add .habitat/plan.sh;
}

function installMeteor() {
function isMeteorInstalled() {

METEOR_VERSION="";
METEOR_VERSION_MEMORY=${HOME}/.meteorVersion;
Expand Down Expand Up @@ -78,7 +78,6 @@ echo -e "${PRTY}Working in ${SCRIPTPATH}/../..";

prepareGitIgnoreFiles;
addHabitatFilesToGit;
installMeteor;

cd ${SCRIPTPATH};
echo -e "${PRTY}Working in ${SCRIPTPATH}";
Expand All @@ -94,6 +93,7 @@ echo -e "\n${PRTY}Installing script dependencies";

## 'jq' parses JSON data "ORIGIN_KEY_ID"
sudo apt -y install jq;
sudo apt -y install curl;

## 'semver_bash' parses and compares version numbers
SEMVER_UTIL="semver_bash";
Expand All @@ -110,6 +110,7 @@ rm -fr ${SEMVER_TAR}*;
# semverLT 0.0.5 0.0.8; echo $?;
# exit 1;

isMeteorInstalled;

echo -e "\n${PRTY}Verifying installed Habitat version.";
# HABITAT_VERSION=$(hab --version);
Expand Down

0 comments on commit fdbc11f

Please sign in to comment.