Skip to content
This repository was archived by the owner on Mar 5, 2020. It is now read-only.

How to use the script tools

Leon Kiefer edited this page Dec 2, 2018 · 5 revisions

The project has various helper scripts located in scripts.

Overview

Script Description Type
fixSingleFileComment Replaces the file comment of the given file with the contents of correctFileComment.txt bash
fixAllFileComments Searches all java files in the project directory and runs fixSingleFileComment on them bash
distributeEclipseSettings Copies all supplied files into all .settings directories in the project. bash
deployGH-Pages Does the necessary steps to generate the content for the github pages after a commit. bash
deployDocker Tags the docker image named amy-master-node with the correct name and pushes it to the docker hub. bash
before_deployMaven Setup the gpg signing key for the release deploy to the maven repo. bash
systemtest Runs a systemtest with the help of docker. bash

fixSingleFileComment

Type: bash
Code: scripts/fixSingleFileComment.sh

Description

This script replaces the file comment of the given file with the correct file comment. The correct file comment is stored in correctFileComment.txt. The scripts overwrites everything before the string package io.github.amyassist.amy

Requirements

The file correctFileComment.txt exists.

Parameters

One parameter is required: The path of the file to be fixed.

fixAllFileComments

Type: bash
Code: scripts/fixAllFileComments.sh

Description

This script replaces the file comment in all java files of the project. For that it searches all files ending in .java and runs fixSingleFileComment on them.

Requirements

The file correctFileComment.txt exists.

Parameters

No parameter.

distributeEclipseSettings

Type: bash
Code: scripts/distributeEclipseSettings.sh

Description

This script distributes eclipse settings files to all eclipse projects in the project. It copies all files passed as parameters and copies them into all .settings directorys found in the project.

Requirements

None

Parameters

Each parameter is one settings file to copy.

deployGH-Pages

Type: bash
Code: scripts/deployGH-Pages.sh

Description

This script generates all the content for the Github Pages. It mainly generates the dependency overview of maven.

Requirements

The correct project structure.

Parameters

No parameter.

deployDocker

Type: bash
Code: scripts/deployDocker.sh

Description

This script deploys the already built docker container to the docker hub. For that it first tags the container named amy-master-node as amyassist/amy:dev and then pushes it to the docker hub.

Requirements

A docker engine, a built container named amy-master-node and the variables $DOCKER_PASSWORD and $DOCKER_USERNAME set appropriately.

Parameters

No parameter.

before_deployMaven

Type: bash
Code: scripts/before_deployMaven.sh

Description

Decrypt the signing key and import it in gpg.

Requirements

The variables $encrypted_12c8071d2874_iv and $encrypted_12c8071d2874_key set by travis and the encrypted file scripts/codesigning.asc.enc.

Parameters

No parameter.

systemtest

Type: bash
Code: scripts/systemtest/systemtests.sh

Description

This script runs a system test in a docker container with the help of docker-compose. The compose file is located at scripts/systemtest/docker-compose.yml and contains the main container and a mqtt broker. The systemtest first starts the two containers and waits for 20 seconds. Then it checks if the webserver is online. Then it stops the containers again. Finally it checks that the exit code of the container is correct and that no errors are in the logs of the container.

Requirements

A docker engine, docker-compose, and curl.

Parameters

No parameter.

Clone this wiki locally