After cloning the project and BEFORE setting up the frontend:
You might want to delete your .git-folder and initialize your repository with git init.
- Open project in Netbeans
- Change project properties (name, artifactID, etc) (right-click project -> refactor)
- Set up your
databaseanddatabase_teston droplet and vagrant (local only).- By default we use
security_base&security_test
- By default we use
- Ensure Vagrant is up
-
In
pom.xmlchangeremote.serverto<YourDroplet>/manager/text -
In
.travis.ymlrename your database to thedatabase_testyou made in step 3. (~line 43) -
If not already done, SSH into your droplet and:
- Open this file:
sudo nano /opt/tomcat/bin/setenv.sh
export DEPLOYED="DEV_ON_DIGITAL_OCEAN" export USER="YOUR_DB_USER" export PW="YOUR_DB_PASSWORD" export CONNECTION_STR="jdbc:mysql://localhost:3306/startcode"- Save the file, and restart Tomcat:
sudo systemcctl restart tomcat
- Open this file:
-
Verify it works with the following script:
mvn clean test -Dremote.user=script_user -Dremote.password=PW_FOR_script_user tomcat7:deploy
-
Change entity passwords in
utils.SetupTestUsers.java- Add the following line to your gitignore:
**/SetupTestUsers.java - Run the files'
main-method.
- Add the following line to your gitignore:
-
Clean & Build -> Run Project.
- Change context path in
META-INF/context.xml
- Go to https://travis-ci.org/.
- Select your repository and activate it.
- Click
More optionsand selectSettings. - Create two new Environment Variables with the following variables:
- REMOTE_PW: Your value for the script_user password
- REMOTE_USER: script_user
- Change something in the code, maybe
index.html - Commit, push, and see your build run on https://travis-ci.org/.
- Your project should be deployed to the URL you set earlier in
pom.xml
- Run
mvn clean testto find build issues - For local purposes make sure to have Vagrant up and correct DB names.
- See the original startup guide: https://github.com/dat3startcode/rest-jpa-devops-startcode