Ftp tweaks #842

Merged
merged 4 commits into from Oct 14, 2013

2 participants

@ochameau
Mozilla member

Some followups from the previous pull request.
Note that, I pushed a new tag (https://github.com/mozilla/r2d2b2g/releases/tag/6.0pre4) associated to the set of xpis I released on ftp (https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/1.2/)

Am I doing it right?!

@ochameau ochameau and 1 other commented on an outdated diff Sep 30, 2013
@@ -37,12 +37,16 @@ endif
B2G_VERSION=1.2
ADDON_NAME=fxos_1_2_simulator
-ADDON_VERSION=6.0pre4
+# compute addon version out of package.json
+# matches xx.yy[pre,a,b]zz version patterns
+ADDON_VERSION=$(shell cat addon/package.json | grep version | grep -oE '[0-9]+\.[0-9]+(pre|a|b)?[0-9]+')
@ochameau
Mozilla member

grep -o doesn't exists on mozillabuild... I'll have to find something else for windows.

@mykmelez
Mozilla member
mykmelez added a note Oct 1, 2013

sed or perl? We seem to use sed quite a bit in the Gaia Makefile.

@mykmelez
Mozilla member
mykmelez added a note Oct 1, 2013

In fact the Build Process doc also uses sed:

sed -i '' s/${OLD_DEV_VERSION}/${BUILD_VERSION}/g addon/package.json

But you need sed -E to use extended regular expressions with plus signs, and MozillaBuild's version of sed is too old for that.

So I think you're going to have to fall back to something like this line of Perl, which works on all three platforms:

grep version addon/package.json | perl -p -e 's/.*([0-9]+\.[0-9]+(pre|a|b)?[0-9]+).*/\1/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ochameau
Mozilla member

I'll update https://github.com/mozilla/r2d2b2g/wiki/Build-Process accordingly when this patch lands.

@mykmelez mykmelez commented on an outdated diff Oct 1, 2013
-production: package
- mkdir -p ftp/$(UPDATE_PATH)/
- cp addon/$(ADDON_NAME).update.rdf ftp/$(UPDATE_PATH)/update.rdf
- cp addon/$(ADDON_NAME).xpi ftp/$(UPDATE_PATH)/$(XPI_NAME)
-
-release: ftp/$(UPDATE_PATH)/$(XPI_NAME) ftp/$(UPDATE_PATH)/update.rdf
- cd ftp/ && lftp sftp://stage.mozilla.org -u $(FTP_USER) -e "mput -O /pub/mozilla.org/labs/r2d2b2g/ -d $(UPDATE_PATH)/$(XPI_NAME); quit;"
- cd ftp/ && lftp sftp://stage.mozilla.org -u $(FTP_USER) -e "mput -O /pub/mozilla.org/labs/r2d2b2g/ -d $(UPDATE_PATH)/update.rdf; quit;"
+production: locales build package
+
+release: addon/$(ADDON_NAME).xpi addon/$(ADDON_NAME).update.rdf
+ @if [ -z $(SSH_USER) ]; then \
+ echo "release target requires SSH_USER env variable to be defined."; \
+ exit 1; \
+ fi
+ ssh $(SSH_USER)@stage.mozilla.org 'mkdir -m 755 -p $(FTP_ROOT_PATH)/$(UPDATE_PATH)'
@mykmelez
Mozilla member
mykmelez added a note Oct 1, 2013

Consider making this 775 so other members of the "labs" group can make changes in these directories if necessary while you're away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mykmelez mykmelez commented on an outdated diff Oct 1, 2013
- mkdir -p ftp/$(UPDATE_PATH)/
- cp addon/$(ADDON_NAME).update.rdf ftp/$(UPDATE_PATH)/update.rdf
- cp addon/$(ADDON_NAME).xpi ftp/$(UPDATE_PATH)/$(XPI_NAME)
-
-release: ftp/$(UPDATE_PATH)/$(XPI_NAME) ftp/$(UPDATE_PATH)/update.rdf
- cd ftp/ && lftp sftp://stage.mozilla.org -u $(FTP_USER) -e "mput -O /pub/mozilla.org/labs/r2d2b2g/ -d $(UPDATE_PATH)/$(XPI_NAME); quit;"
- cd ftp/ && lftp sftp://stage.mozilla.org -u $(FTP_USER) -e "mput -O /pub/mozilla.org/labs/r2d2b2g/ -d $(UPDATE_PATH)/update.rdf; quit;"
+production: locales build package
+
+release: addon/$(ADDON_NAME).xpi addon/$(ADDON_NAME).update.rdf
+ @if [ -z $(SSH_USER) ]; then \
+ echo "release target requires SSH_USER env variable to be defined."; \
+ exit 1; \
+ fi
+ ssh $(SSH_USER)@stage.mozilla.org 'mkdir -m 755 -p $(FTP_ROOT_PATH)/$(UPDATE_PATH)'
+ chmod 766 addon/$(ADDON_NAME).xpi addon/$(ADDON_NAME).update.rdf
@mykmelez
Mozilla member
mykmelez added a note Oct 1, 2013

This is a weird permission set for a file. Typically such files are 644, although this should perhaps be 664 so other members of the "labs" group can make changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mykmelez
Mozilla member

Note that, I pushed a new tag (https://github.com/mozilla/r2d2b2g/releases/tag/6.0pre4) associated to the set of xpis I released on ftp (https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/1.2/)

Am I doing it right?!

The tag looks good to me. The idea is to set it to the revision that was checked out when you produced the builds, so it's possible to reproduce them by checking out the tag and rebuilding.

@ochameau
Mozilla member

I fixed the file permissions and used perl (it works fine, thanks for the tip!)

@ochameau ochameau merged commit 510fb97 into mozilla:master Oct 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment