Skip to content
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

CI system #10

Open
frafra opened this issue May 11, 2021 · 11 comments
Open

CI system #10

frafra opened this issue May 11, 2021 · 11 comments

Comments

@frafra
Copy link
Collaborator

frafra commented May 11, 2021

I would suggest adding a continuous integration system to test each commit and pull request.
A basic CI system could consist initially in building the docker image; basic tests could be added afterwards.
We could rely on GitHub Actions (https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action#creating-an-action-metadata-file) or use an external service, like Circle CI.

This would also be beneficial to have basic testing for the dependabot PRs (dependabot could also check for outdated images in Dockerfiles).

I would be glad to help with that. Having a group on GitHub instead of relying on personal repositories, could help others to join in maintaining and supporting projects like GSS and SMASH (configuring dockerhub to read from an organization, setting up github actions, PR policies and such).

@moovida
Copy link
Member

moovida commented May 11, 2021

With group you mean an organisation?

Actually I don't even know why GSS and SMASH are not yet under the geopaparazzi org: https://github.com/geopaparazzi

If that is what you meant I will be more than happy to move them over there.

(well, for a couple of days I will be working on other things, so it might be towards the weekend).

@frafra
Copy link
Collaborator Author

frafra commented May 11, 2021

Right; it could be a good idea to move them there :)

@moovida
Copy link
Member

moovida commented May 11, 2021

Great, will move things over as soon as possible.

@moovida
Copy link
Member

moovida commented May 11, 2021

Well, it was very straightforward. It is now all under geopaparazzi. :-)

@frafra
Copy link
Collaborator Author

frafra commented May 11, 2021

I would then ask to become part of the organization, so I can propose new PR on this very same repository and configure GitHub actions and such.

@frafra
Copy link
Collaborator Author

frafra commented Mar 22, 2022

It looks like we have some basic CI now, using GitHub actions and Docker build :) That should be just enough to check that the dependencies do not have major issues :)

@frafra frafra closed this as completed Mar 22, 2022
@moovida
Copy link
Member

moovida commented Mar 22, 2022

Since we are at it and you are the actions magician... how much work would it take to port such a script to github actions? :-)

STARTDIR=`pwd`

SOURCEFOLDER=$HOME/development/GEOPAPARAZZI/geopaparazzi-survey-server-flutter

# BUILD BACKBONE
SERVERFOLDER=$SOURCEFOLDER/flutter_server_backbone/
CLIENTFOLDER=$SOURCEFOLDER/flutter_server/

cd $SERVERFOLDER
VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
mvn -q clean
mvn -q install 

cd $STARTDIR

NAME=GSS_$VERSION
BUILDFOLDER=$STARTDIR/$NAME
rm -rd $BUILDFOLDER
rm -rd $BUILDFOLDER.tar.gz
mkdir $BUILDFOLDER
cp -rv $SERVERFOLDER/target/lib $SERVERFOLDER/target/gss-backbone-$VERSION.jar $BUILDFOLDER

# BUILD CLIENT
cd $CLIENTFOLDER
rm -rf $CLIENTFOLDER/build/

flutter build web --release

mv $CLIENTFOLDER/build/web $BUILDFOLDER/public
cp $CLIENTFOLDER/web/favicon.png $BUILDFOLDER/public/

echo "VERSION=$VERSION" > $BUILDFOLDER/run.sh
echo "WORKSPACE=$HOME/GSSSERVER/" >> $BUILDFOLDER/run.sh
echo "MEM=-Xmx4g" >> $BUILDFOLDER/run.sh
echo "java \$MEM -jar gss-backbone-\$VERSION.jar -w \$WORKSPACE -mp testPwd >> $BUILDFOLDER/run.sh

chmod 755 $BUILDFOLDER/run.sh

cd $STARTDIR
tar -czvf $NAME.tar.gz $NAME/
rm -rf $NAME

Clearly some paths refer to my environment.

This would allow for a complete release (also for mere human not using docker).

@frafra
Copy link
Collaborator Author

frafra commented Mar 22, 2022

We have something similar in Docker build already. My suggestion would be to improve the Dockerfile, if needed, and just copy the files out of the Docker image. This would also help in avoiding duplication and make it easier to replicate the CI locally, in my opinion.

@frafra frafra reopened this Mar 22, 2022
@moovida
Copy link
Member

moovida commented Mar 22, 2022

Hmmm, it sounds like a great plan. I just didn't even know you could copy files out of the image :-D Usually I guess the reverse is done.
Would you be keen/have time to implementing this?

@frafra
Copy link
Collaborator Author

frafra commented Mar 24, 2022

I would be glad to help :)

@moovida
Copy link
Member

moovida commented Mar 24, 2022

Thanks, we could do it next week at some point? Then I could be available and maybe contribute (while learning :-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants