-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta: move deploy process to Travis #2941
Conversation
Dockerfile
Outdated
|
||
# Get Wattsi and html-build; compile Wattsi and put it in the PATH. | ||
RUN apt-get update && \ | ||
apt-get install -y ca-certificates curl git unzip fp-compiler-3.0.0 && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want fp-compiler (virtual package) or fp-compiler-3.0.2 (concrete version) instead of fp-compiler-3.0.0 (outdated, spark64-only version)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That explains it...
deploy.sh
Outdated
./html-build/build.sh | ||
|
||
# Conformance-check the result | ||
/usr/lib/jvm/java-8-oracle/jre/bin/java -jar vnu.jar --skip-non-html ./html-build/output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure debian:sid image has this by default. You'd need to install java too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts on the right package name? Apparently we want Oracle Java 8...
Dockerfile
Outdated
|
||
# Get Wattsi and html-build; compile Wattsi and put it in the PATH. | ||
RUN apt-get update && \ | ||
apt-get install -y ca-certificates curl git unzip fp-compiler oracle-java8-installer && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'm sorry, I might have misled you! There's no Oracle's Java package in Debian. You'll need to use PPA (or some other way) and, somehow, accept their license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, happy to use not-Debian; any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, don't know any. Oracle has a scary license with a no-distribution thing. So Ubuntu doesn't have it either (only in PPAs.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Ubuntu's PPA, though, it's possible:
add-apt-repository ppa:webupd8team/java &&
apt-get update &&
apt-get install oracle-java8-installer
but it will ask you to accept the license on first install.
To workaround that (not sure about legal side of this though):
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
deploy.sh
Outdated
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" | ||
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" | ||
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} | ||
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing: I strongly suspect these env variables will not be visible from within the container, you'll need to pass them in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the dockerfile does that successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok.
This builds and validates the spec entirely on Travis, and then deploys it to the WHATWG servers. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. While here, we update the Travis configuration to no longer runs Travis on both pull requests and branches, but instead only on pull requests.
deploy.sh
Outdated
TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:-false} | ||
|
||
# Work in the parent directory | ||
cd .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd ..
Nit: If cd
fails for some reason (though yeah I realize that in this particular case it almost certainly can’t…), it’s always best to instead do:
cd .. || exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the errexit at the top takes care of that
It seems slightly cleaner to move the files if it's not a problem. The other thing I was wondering about is that here .travis.yml looks a little different from elsewhere. There's no ENCRYPTION_LABEL and DEPLOY_USER. Also, did you add the public key to the server already? |
This ends up fixing whatwg/html-build#103 by the way, once it lands. |
deploy.sh
Outdated
|
||
# scp to the WHATWG server | ||
echo "$SERVER $SERVER_PUBLIC_KEY" > known_hosts | ||
scp -r -o UserKnownHostsFile=known_hosts html-build/output "$DEPLOY_USER@$SERVER:$WEB_ROOT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use whatwg/html-build#99 (comment) instead? Or better as a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, perhaps I'll try that.
ENCRYPTION_LABEL got inlined into some of the commands in .travis.yml. There I went for brevity (one line, but with the encryption label duplicated twice in that line) over configurability. We need to either decrypt in .travis.yml, or have two deploy.sh scripts, one for running on Travis (with access to encrypted environment variables), and one for running inside the Docker container. Although, doing two deploy scripts is not so bad, one we move them out of the repo. I guess I'll try that.
I've hard-coded it to your username, since this is only for one spec. DEPLOY_USER is used since other specs deploy to various different users all through a single deploy script. But we're not using a shared deploy script here.
Yep. |
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941. Fixes #11. Fixes #99. Fixes #103.
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941. Fixes #11. Fixes #99. Fixes #103.
This is ready for review again. Proposed new commit message:
It needs to be merged after the corresponding html-build PR, and until that is merged Travis will fail this branch. Marking "do not merge yet" for that reason. |
This adds a new subdirectory, ci-deploy, with scripts and other resources for building, validating, and deploying the spec entirely on Travis. Previously Travis was only running build and validation steps, but then throwing away the results, letting custom deploy architecture handle the actual deploy. This replaces the custom deploy architecture with something in source control and web-host-agnostic. This deploy is Docker-based, for two main reasons: * It is not easy to install FreePascal 3.x onto Travis CI's default Ubuntu configuration, which is fairly old (even with recent Trusty updates). It is simpler to create a Docker container with a recent OS and install FreePascal 3.x there. * Docker has a good mechanism for caching previous results and not doing unnecessary work until the cache is invalidated. This is important as it allows us to avoid reinstalling prerequisite packages and recompiling Wattsi on every build. Travis CI has some caching support, but it is not as full-featured as Docker's. The intermediate containers created for this caching are stored on Docker Hub; see https://hub.docker.com/r/whatwg/html-deploy. The ci-deploy/README.md file contains more instructions on how this is expected to be used, and will be used by whatwg/html's .travis.yml in whatwg/html#2941. Fixes #11. Fixes #99. Fixes #103.
Meta: move deploy process to Travis
This builds and validates the spec entirely on Travis, and then deploys
it to the WHATWG servers. Previously Travis was only running build and
validation steps, but then throwing away the results, letting custom
deploy architecture handle the actual deploy. This replaces the custom
deploy architecture with something in source control and
web-host-agnostic.
This deploy is Docker-based, for two main reasons:
Ubuntu configuration, which is fairly old (even with recent Trusty
updates). It is simpler to create a Docker container with a recent OS
and install FreePascal 3.x there.
unnecessary work until the cache is invalidated. This is important as
it allows us to avoid reinstalling prerequisite packages and
recompiling Wattsi on every build. Travis CI has some caching support,
but it is not as full-featured as Docker's. The intermediate
containers created for this caching are stored on Docker Hub; see
https://hub.docker.com/r/whatwg/html-deploy.
While here, we update the Travis configuration to no longer runs Travis
on both pull requests and branches, but instead only on pull requests.
After about a day of working on this I am pretty happy with it. As you can see from e.g. https://travis-ci.org/whatwg/html/builds/265797292 build times are pretty fast (less than 2 minutes) and don't do a lot of unnecessary work.
Although the actual deploy part is untested, I am hoping that works pretty straightforwardly. Maybe I should test it by temporarily disabling the "if on a pull request, bail out" logic.
Code review appreciated, although it's fine if it's not in depth. Also I'm curious if people think deploy.sh and the Dockerfile should belong in html-build; it's not a problem to move them.