Skip to content

Instantly share code, notes, and snippets.

@vincenzo
Last active February 8, 2017 11:41
Show Gist options
  • Save vincenzo/2c47733e334f2fb2bcdd3b4fc6ebc3a3 to your computer and use it in GitHub Desktop.
Save vincenzo/2c47733e334f2fb2bcdd3b4fc6ebc3a3 to your computer and use it in GitHub Desktop.
Change repo structure
Project k2eya57d5oqcm could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project pgzierefj4csc could not be processed due to lack of available environments. Total number of available environments: 3 - Number of environments used: 4
Project tglhp53fzconu could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project cf2n7pzkhcf5e could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project w4vkbjym5rnka could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project 2ngsdsa3a3t2y could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project jsznqslhihyhk could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project jgex3bynzmule could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project wujezy6emgymm could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project 2h4354rapx5f6 could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project 5ruhkmkueawqm could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project 4fgn7zr63osds could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project refsklfzrwbvg could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project fpxqkmm2fmjie could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project dfcocujp5d3mg could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project ns76qfzpyv4pg could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project tn5x7a4zm7wwq could not be processed due to lack of available environments. Total number of available environments: 3 - Number of environments used: 4
Project ukbodou7rvu44 could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 6
Project mfokwetwh3ev2 could not be processed due to lack of available environments. Total number of available environments: 6 - Number of environments used: 7
Project hyh5jjhupozw2 could not be processed - Github Integration
Restructuring repository for dvfxvwgcmboze ...
Restructuring repository for kystefszx2ybm ...
Restructuring repository for u3tucrjygkrgk ...
Restructuring repository for a5yguv75bogig ...
Restructuring repository for hyh5jjhupozw2 ...
Restructuring repository for lnjnmqjlfjply ...
Restructuring repository for ieubiifnqoxdu ...
Restructuring repository for nx7t2aypc4qr6 ...
Restructuring repository for x674tczpw653q ...
Restructuring repository for yemse4pemhngo ...
Restructuring repository for xntlws5lebruc ...
Restructuring repository for kgixp5dbvs3oe ...
Restructuring repository for yyvqenv3zkpeq ...
Restructuring repository for 3qzppwhbj27vo ...
Restructuring repository for xont557pnukw4 ...
Restructuring repository for 3ab5s63nqjtyi ...
Restructuring repository for 65w4buizsilta ...
Restructuring repository for vat4eqttrytj4 ...
Restructuring repository for hd7b5w76m6xwg ...
Restructuring repository for hfnplukt4i5ei ...
Restructuring repository for tjm3wfcxaby2i ...
Restructuring repository for 5nitlqi7ncg6w ...
Restructuring repository for 3vsbsiw33vqom ...
Restructuring repository for pvflx5cjjtmdw ...
Restructuring repository for ik2kvlvlbwkjk ...
Restructuring repository for 6dxjj2ag6o3te ...
Restructuring repository for ulrfdpb4pw7qq ...
Restructuring repository for 5sftb4siljqmk ...
Restructuring repository for ixfttrejhzxhm ...
Restructuring repository for w652uvl2puc6w ...
Restructuring repository for 2ffd3uvheajka ...
Restructuring repository for pzul54ufcegdm ...
Restructuring repository for kazznh3emcbme ...
Restructuring repository for i4lb2nfsnsl2u ...
Restructuring repository for 6pnukeil3itja ...
Restructuring repository for ewdkqfbgofc5c ...
Restructuring repository for gdotifxleqvag ...
Restructuring repository for 7gcvsy5pd5lxq ...
Restructuring repository for xpchqwsl56lzc ...
Restructuring repository for 63bb4hkonzadm ...
Restructuring repository for ze4huc4dslbeq ...
Restructuring repository for adea5pvlvuzgk ...
Restructuring repository for efpkazelykdf4 ...
Restructuring repository for ol3g5tkmi57d4 ...
Restructuring repository for 6qeu3hdzxgsbo ...
Restructuring repository for 2ajcgq3nn5ynq ...
Restructuring repository for tc6gzowbb4ttk ...
Restructuring repository for 66tlbpsof5bi6 ...
Restructuring repository for dx4zjght5lypa ...
Restructuring repository for dmugh2ixsikxe ...
Restructuring repository for uxiocrqgycnmw ...
Restructuring repository for kldropfti5cva ...
Restructuring repository for g7bi42pjy4vik ...
Restructuring repository for nb2p5ktk3kjms ...
Restructuring repository for av7oki6i4efdg ...
Restructuring repository for xwafxdjh2bcyo ...
caribbean.britishcouncil.org
content.britishcouncil.org
digital.britishcouncil.org
iran.britishcouncil.org
iraq.britishcouncil.org
kosovo.britishcouncil.org
nireland.britishcouncil.org
scotland.britishcouncil.org
southsudan.britishcouncil.org
study-uk.britishcouncil.org
sudan.britishcouncil.org
training.britishcouncil.org
uk-india.britishcouncil.in
venicebiennale.britishcouncil.org
wales.britishcouncil.org
www.britishcouncil.al
www.britishcouncil.am
www.britishcouncil.az
www.britishcouncil.ba
www.britishcouncil.be
www.britishcouncil.bg
www.britishcouncil.ch
www.britishcouncil.cm
www.britishcouncil.com.sn
www.britishcouncil.co
www.britishcouncil.com.cy
www.britishcouncil.com.kw
www.britishcouncil.de
www.britishcouncil.dz
www.britishcouncil.ee
www.britishcouncil.es
www.britishcouncil.fr
www.britishcouncil.ge
www.britishcouncil.hk
www.britishcouncil.hr
www.britishcouncil.ie
www.britishcouncil.in
www.britishcouncil.it
www.britishcouncil.jo
www.britishcouncil.kr
www.britishcouncil.kz
www.britishcouncil.lk
www.britishcouncil.ly
www.britishcouncil.ma
www.britishcouncil.me
www.britishcouncil.mk
www.britishcouncil.mu
www.britishcouncil.mw
www.britishcouncil.my
www.britishcouncil.na
www.britishcouncil.no
www.britishcouncil.om
www.britishcouncil.or.th
www.britishcouncil.or.tz
www.britishcouncil.org
www.britishcouncil.org.ar
#!/usr/bin/env bash
mkdir -p ~/projects
> ~/projects/failed.log
> ~/projects/messages.log
platform projects --pipe |
while read P; do
GROUP=$(platform variable:get -p ${P} -e master GROUP --pipe);
if [ "$GROUP" = "SOLAS" ]; then
echo "Fetching project ${P} ..."
platform get ${P} -e qa ~/projects/${P} -y -q
cd ~/projects/${P}/
if [ ! -d "./site" ]; then
mkdir site
mv * site/ 2>/dev/null
mv .platform.app.yaml site/
git add -A
git commit -qam "Move app into site dir."
git push platform qa
else
echo "Project ${P} was already processed. Skipping ..."
echo "Project ${P} was already processed. Skipping ..." >> ~/projects/messages.log
fi
else
echo "Project ${P} is not a Solas project. Skipping ..."
echo "Project ${P} is not a Solas project. Skipping ..." >> ~/projects/messages.log
fi
done
#!/usr/bin/env bash
BRANCH="restructure"
mkdir -p ~/projects
> ~/projects/failed.log
> ~/projects/messages.log
platform projects --pipe |
while read P; do
GROUP=$(platform variable:get -p ${P} -e master GROUP --pipe);
if [ "$GROUP" = "SOLAS" ]; then
echo "Fetching project ${P} ..."
platform get ${P} -e qa ~/projects/${P} -y -q
cd ~/projects/${P}/
current_active_envs=$(platform environments -I --pipe | wc -l)
total_env_count=$(platform project:info subscription | grep environments | cut -d ":" -f 2 | tr -d " ");
if [ $total_env_count -gt $current_active_envs ]; then
platform branch --no --no-wait ${BRANCH} qa
if [ $? -eq 0 ]; then
echo "Restructuring repository for ${P} ..."
echo "Restructuring repository for ${P} ..." >> ~/projects/messages.log
mkdir site
mv * site/ 2>/dev/null
mv .platform.app.yaml site/
git add -A
git commit -qam "Move app into site dir."
git push platform ${BRANCH}
else
echo "Project ${P} was already processed. Skipping ..."
echo "Project ${P} was already processed. Skipping ..." >> ~/projects/messages.log
fi
else
echo "Project ${P} could not be processed due to lack of available environments."
echo "Total number of available environments: $total_env_count - Number of environments used: $current_active_envs"
echo "Project ${P} could not be processed due to lack of available environments. Total number of available environments: $total_env_count - Number of environments used: $current_active_envs" >> ~/projects/failed.log
fi
else
echo "Project ${P} is not a Solas project. Skipping ..."
echo "Project ${P} is not a Solas project. Skipping ..." >> ~/projects/messages.log
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment