Perforce Web Services is actually a suite of several different kinds of applications, client libraries, and utilities (like installers) that form a kind of microservice system for applications.
Projects that are simple (they make one thing), have all their code directly underneath this directory.
Projects that have clients, or are broken up into multiple related projects, have a subdirectory under this that groups these related projects together. See the p4_project_services tree as an example.
Because these projects may be distributed via RubyGems for heavily customized deployments, prefix everything with 'p4_'.
Each project is versioned independently.
The underlying p4_web_api is actually quite tied to the underlying P4 server version, since that's what defines all data. This will need to match the major/minor version of the Perforce instance.
Other projects do not have to follow this convention. Instead, they should attempt to follow a strict semantic versioning mechanism:
Builds are performed in a salt cluster, one per each supported platform.
Each build starts with the build machine syncing to a new changelist number. Package files are then synced to a test machine, where we install the next set of packages.
Tests are then run from the build master against the updated test environment.
First steps are to change the hostname and add the perforce user as a nopasswd sudoer:
$ sudo visudo
Then add this line
perforce ALL=(ALL:ALL) NOPASSWD:ALL
Ubuntu 12 environments:
First, update and upgrade the system
Install vim
Add the public key to the pkg-ondemand repo
$ wget -q http://pkg-ondemand.bnr.perforce.com/perforce.pubkey -O - | sudo apt-key add -
Create the apt source
$ sudo bash -c 'echo deb http://pkg-ondemand.bnr.perforce.com/perforce/r15.1/apt/ubuntu precise release > /etc/apt/sources.list.d/perforce.sources.list'
$ sudo apt-get update
Install the perforce server
$ sudo apt-get install perforce-server
master $ sudo salt -G 'node_type:buildmaster' state.highstate
master $ sudo salt-key -A
master $ sudo salt -G 'node_type:build' state.highstate
Create p4ws.tgz
master $ cd /home/$USER/p4ws
master $ /home/$USER/.rvm/wrappers/ruby-2.2.2@build/bundle install
master $ /home/$USER/.rvm/wrappers/ruby-2.2.2@build/bundle exec rake clean package
Push the source tree and build packages
sudo salt-cp -G 'node_type:build' salt-cp pkg/p4ws.tgz /var/tmp
sudo salt -G 'node_type:build' cmd.run 'tar xvz -C /var/tmp -f /var/tmp/p4ws.tgz' runas='vagrant'
sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws'
sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth'
sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle exec omnibus build p4_web_services_auth' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth'
sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api'
sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle exec omnibus build p4_web_api' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api'
sudo salt -G 'node_type:build' cp.push '/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth/pkg/p4-web-services-auth_2015.2.0.main1-1_amd64.deb'
sudo salt -G 'node_type:build' cp.push '/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api/pkg/p4-web-api_2014.2.0.pre6-1_amd64.deb'
sudo salt -G 'node_type:build' cmd.run 'rm -rf /var/tmp/p4ws*'
p4ws - Perforce Web Services ---------------------------- ## Project Structure Perforce Web Services is actually a suite of several different kinds of applications, client libraries, and utilities (like installers) that form a kind of microservice system for applications. Projects that are simple (they make one thing), have all their code directly underneath this directory. Projects that have clients, or are broken up into multiple related projects, have a subdirectory under this that groups these related projects together. See the p4_project_services tree as an example. ## Project Naming Because these projects may be distributed via RubyGems for heavily customized deployments, prefix everything with 'p4_'. ## Versioning Each project is versioned independently. The underlying p4_web_api is actually quite tied to the underlying P4 server version, since that's what defines all data. This will need to match the major/minor version of the Perforce instance. Other projects do *not* have to follow this convention. Instead, they should attempt to follow a strict semantic versioning mechanism: - Major version number indicate a breaking change in the API. - Minor version numbers indicate an addition, that shouldn't break any existing clients. - Release numbers just indicate a new release, probably for bug fixes. ## Build Automation Builds are performed in a salt cluster, one per each supported platform. Each build starts with the build machine syncing to a new changelist number. Package files are then synced to a test machine, where we install the next set of packages. Tests are then run from the build master against the updated test environment. ### Machine Setup First steps are to change the hostname and add the perforce user as a nopasswd sudoer: $ sudo visudo Then add this line perforce ALL=(ALL:ALL) NOPASSWD:ALL Ubuntu 12 environments: 1. First, update and upgrade the system 2. Install vim 3. Add the public key to the pkg-ondemand repo $ wget -q http://pkg-ondemand.bnr.perforce.com/perforce.pubkey -O - | sudo apt-key add - 4. Create the apt source $ sudo bash -c 'echo deb http://pkg-ondemand.bnr.perforce.com/perforce/r15.1/apt/ubuntu precise release > /etc/apt/sources.list.d/perforce.sources.list' $ sudo apt-get update 5. Install the perforce server $ sudo apt-get install perforce-server ## Notes on Automated builds master $ sudo salt -G 'node_type:buildmaster' state.highstate master $ sudo salt-key -A master $ sudo salt -G 'node_type:build' state.highstate Create p4ws.tgz master $ cd /home/$USER/p4ws master $ /home/$USER/.rvm/wrappers/ruby-2.2.2@build/bundle install master $ /home/$USER/.rvm/wrappers/ruby-2.2.2@build/bundle exec rake clean package Push the source tree and build packages sudo salt-cp -G 'node_type:build' salt-cp pkg/p4ws.tgz /var/tmp sudo salt -G 'node_type:build' cmd.run 'tar xvz -C /var/tmp -f /var/tmp/p4ws.tgz' runas='vagrant' sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws' sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth' sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle exec omnibus build p4_web_services_auth' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth' sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle install' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api' sudo salt -G 'node_type:build' cmd.run '/home/vagrant/.rvm/wrappers/ruby-2.2.2@build/bundle exec omnibus build p4_web_api' runas='vagrant' cwd='/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api' sudo salt -G 'node_type:build' cp.push '/var/tmp/p4ws/p4_web_services_auth/packaging/omnibus-p4_web_services_auth/pkg/p4-web-services-auth_2015.2.0.main1-1_amd64.deb' sudo salt -G 'node_type:build' cp.push '/var/tmp/p4ws/p4_web_api/omnibus-p4_web_api/pkg/p4-web-api_2014.2.0.pre6-1_amd64.deb' sudo salt -G 'node_type:build' cmd.run 'rm -rf /var/tmp/p4ws*'
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#10 | 17194 | tjuricek | Remove obsolete instructions and links. | ||
#9 | 15686 | tjuricek | Removed Qt SDK (will be maintained with Helix Sync), updated README | ||
#8 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
#7 | 13974 | tjuricek |
Moving 'ui/static' to 'helix_web_components' project, and altering some notes. Also, removed obsolete top-level Rake tasks. The "Helix Web Components" project will likely get moved elsewhere in the future. |
||
#6 | 13558 | tjuricek | Removing the text diagram (looks horrible) and replacing with just a list. | ||
#5 | 13557 | tjuricek |
Revise the README.md Right now just want a basic overview of what the project is for people to gain basic understanding. Real documentation is underway with an Asciidoc conversion. |
||
#4 | 13520 | tjuricek |
Created a 'cluster' build procedure that creates an installer on build, and executes the install on a test instance. The main change is to package all gem dependencies via 'vendor/cache' (using the 'bundle package' command). Right now, there appears to be an issue with test data initialization, which may need a revised approach. |
||
#3 | 13519 | tjuricek |
Added a 'buildmaster' environment. The 'buildmaster' sets up Ruby locally for doing some work via Rake. Additional steps are now being figured out in the README.md, which may end up being a bash script that executes on the master. |
||
#2 | 13518 | tjuricek | Revised the 'build' environment to not hard-code the vagrant user, and not assume we have the p4ws tree available for state.highstate. | ||
#1 | 13514 | tjuricek |
Revised some of the p4_web_api tests to work under the installed 'production' perforce system. Notes on data resets: sudo p4dctl stop helix-evaluation sudo rm -rf /var/lib/perforce/p4d sudo /opt/perforce/sbin/configure-perforce-server.sh helix-evaluation -n -p 1666 -r /var/lib/perforce/p4d -u super -P 'superuser1A!' --unicode sudo su webservices /home/webservices/.rvm/wrappers/ruby-2.2.2@p4webapi/p4util init -p :1666 /home/vagrant/p4ws/p4init |
||
//guest/perforce_software/helix-web-services/main/README | |||||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |