Swiftpack.co - Package - marcusjwhelan/swiftDevOpsTester

API Template

Documentation Team Chat MIT License Continuous Integration Swift 4.1

Start Development

Cloning

git clone --recursive https://github.com/marcusjwhelan/swiftDevOpsTester.git

Start container cluster in detached mode don't cache the build setup

docker-compose build --no-cache
docker-compose up -d

Attach to container

hit enter twice to get to bash prompt of container

docker attach vapor_it_container

In api:dev container build application and start it

swift build && swift run Run serve -b 0.0.0.0

Should get output

Server starting on http://0.0.0.0:8080

Application can be accessed now at localhost:8080/users for list of users or posting.

Test locally

Runs local build structured test from /.circleci/config.yml

circleci local execute --job build-image

Pushing to Docker hub

All that needs to be done is commit to the master branch.

Possibly changed to it having to be a pull request. not sure if it has to be on master

Add content through users

Using postman hit address localhost:8080/users/ with a post request holding {"username":"content","password":"admin"}. Now your first user is added. This is the simple route on the end of an api.

Turn off dev env

docker-compose down

Setting up project

When adding client I used gatsby from the outside then cd into gatsby client directory. Did all the git init work and created new repo on github. Once that was done I navigated back to project directory and made the client directory a submodule with

git submodule add https://github.com/marcusjwhelan/swiftDevOpsTesterReact.git client

And a git push -f