The Eclipse ServiceStage Plugin provides simple integration with Huawei Cloud's ServiceStage service for application developers.
- configure application
- create application
- update application
- view application status
A pre-built ServiceStage plugin jar can be found under the servicestage-eclipse-plugin/plugins
folder. If you would like to build the plugin from the ServiceStage plugin source code, see Build to first build and obtain the plugin jar file.
At this moment, the plugin must be installed manually. Once you have the ServiceStage plugin jar, place it in ${ECLIPSE_INSTALLATION}/dropins
. For example, if Eclipse is install in /eclipse
on your system, then place the plugin jar inside /eclipse/dropins
. Then restart Eclipse to pickup the changes.
Note: you may use the right-click context menu, tool bar or the main menu to perform the Configure, Deploy, and Status actions. Deploy will only be visible when a java war/jar file or a Node.js project are selected.
Configure ServiceStage Preferences (Window > Preferences > ServiceStage
)
- Select the region
- Provide username and password
The page also provides a Reset Token
button, if you are having issues later, it may help to reset the token.
Now you can create your own application projects, each project in your workspace will have a different set of ServiceStage settings associated with it. These settings will be stored in servicestage.xml
at the project root. Note: this plugin currently supports tomcat WAR file, Java Jar package and node.js or PHP applications.
- Right-click the project and select
ServiceStage > Configure
- Fill in the application information
- Provide the SWR repo where files will be uploaded before they can be deployed
- Select Platform information such as Cluster ID, ELB ID, VPC ID
- Provide information about services that your application uses
- Provide optional environment variables for your application (Note: some application Categories have mandatory environment variables)
- Click Finish. The project's
servicestage.xml
file will be created/updated
Once your preferences and application information have been configured, you are ready to deploy your war file.
- Build your project and generate the war file, if needed
- From the Project Explorer, right-click the war file/Node.js project and select
ServiceStage > Deploy
- The deployment process will begin and provide progress information.
The deployment process is as follows:
- The selected war file/Node.js project is uploaded to SWR
- The application is deployed/updated to ServiceStage
- The deployment is monitored until it completes and the application URL is provided at the end
If there is an issue with the deployment at any stage, a dialog appears showing the reason for the failure. You can also view the Error log
view for details.
If you the deployment fails, or the application is deleted from the ServiceStage Web Console, you will need to use a new ID to redeploy the application. This can be done by opening the Configure dialog again, and clicking Reset ID, then Finish.
You can check the status of your application at any time.
- Right-click the project and select
ServiceStage > Status
The plugin has a dependency on servicestage-client.jar. A copy of the file has already been included in the ./lib
directory.
If you make changes to the servicestage-java-client
client, it must be built again. Put the servicestage-java-client project in the same parent directory as this plugin project. For example:
workspace
├── com.huawei.cloud.servicestage.eclipse
│ ├── lib
│ └── get-dependencies.sh
└── servicestage-java-client
If your Eclipse workspace running within an Linux environment, you can run get-dependencies.sh
from inside the plugin's project root directory. This will build servicestage-client.jar
and place it under the ./lib
directory.
If your Eclipse workspace running within a Windows environment, you can run the following steps manually to compile and place servicestage-client.jar
:
mvn clean package -DskipTests -DfinalName=servicestage-client
copy .\servicestage-java-client\target\servicestage-client.jar ..\servicestage-eclipse-plugin\lib\
- Import the plugin project into Eclipse and make sure it builds without errors
- Right-click the project
servicestage-eclipse-plugin
and select Export - Select "Plug-in Development -> Deployable plug-ins and fragments"
- Select "Archive file" and provide the path to create the plugin output zip file (for example: service-eclipse-plugin.zip)
- Unzip the output file to a temp folder, the plugin jar will be in the
plugins
directory
Follow the instructions under Build to get started.
Before submitting changes, make sure to format the code correctly, this will make merging code easier.
Import formatter profile:
Window > Preferences > Java > Code Style > Formatter
- Click Import and Select
JavaFormatter.xml
from the project's root directory.
Next, right-click on the source packages under the project, e.g. src/main/java
and select Source > Format
.
Apache 2.0. See LICENSE.txt.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.