Skip to content

Commit

Permalink
dist: fix build config formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasbaldi committed Nov 30, 2018
1 parent df8e118 commit b62a90e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
- run:
name: Install Server Dependencies Prod
command: |
rm -rf server/node_modules
cd server; npm install --production
rm -rf server/node_modules
cd server; npm install --production
# BUILD: CLIENT
- run:
Expand All @@ -61,23 +61,23 @@ jobs:
- run:
name: Run Docker Build
command: |
VERSION=$(node -p -e "require('./server/package.json').version")
# pack application
rm -rf server/public; mv ./client/dist ./server/public
cd server && tar -czf ../stjorna-$VERSION.tar.gz *
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} docker.io
cd ../ && docker build --pull --build-arg VERSION=$VERSION -t docker.io/secanis/stjorna:$VERSION -t docker.io/secanis/stjorna:latest -t docker.io/secanis/stjorna:dev-${CIRCLE_BRANCH/\//-} .
# docker build: if RELEASE then push it
if [ -n "$RELEASE" ]; then
# docker push
docker push docker.io/secanis/stjorna:$VERSION
docker push docker.io/secanis/stjorna:latest
# git tagging
API_JSON=$(printf '{"tag_name": "v%s","target_commitish": "master","name": "v%s","body": "Release of version %s","draft": false,"prerelease": false}' $VERSION $VERSION $VERSION)
curl --data "$API_JSON" https://api.github.com/repos/secanis/stjorna/releases?access_token=$GITHUB_KEY
fi
# otherwise publish the current branch build
docker push docker.io/secanis/stjorna:dev-${CIRCLE_BRANCH/\//-}
VERSION=$(node -p -e "require('./server/package.json').version")
# pack application
rm -rf server/public; mv ./client/dist ./server/public
cd server && tar -czf ../stjorna-$VERSION.tar.gz *
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} docker.io
cd ../ && docker build --pull --build-arg VERSION=$VERSION -t docker.io/secanis/stjorna:$VERSION -t docker.io/secanis/stjorna:latest -t docker.io/secanis/stjorna:dev-${CIRCLE_BRANCH/\//-} .
# docker build: if RELEASE then push it
if [ -n "$RELEASE" ]; then
# docker push
docker push docker.io/secanis/stjorna:$VERSION
docker push docker.io/secanis/stjorna:latest
# git tagging
API_JSON=$(printf '{"tag_name": "v%s","target_commitish": "master","name": "v%s","body": "Release of version %s","draft": false,"prerelease": false}' $VERSION $VERSION $VERSION)
curl --data "$API_JSON" https://api.github.com/repos/secanis/stjorna/releases?access_token=$GITHUB_KEY
fi
# otherwise publish the current branch build
docker push docker.io/secanis/stjorna:dev-${CIRCLE_BRANCH/\//-}
- store_artifacts:
path: stjorna-*.tar.gz

0 comments on commit b62a90e

Please sign in to comment.