Skip to content

Commit

Permalink
Release 1.1.0 (#616)
Browse files Browse the repository at this point in the history
* Version 1.1.0
  • Loading branch information
baghbidi authored Jun 24, 2019
1 parent 95d0eb3 commit 2fae0cb
Show file tree
Hide file tree
Showing 167 changed files with 14,099 additions and 1,954 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {

'extends': 'google',
'rules': {
"linebreak-style": 0,
'require-jsdoc': [OFF, {
'require': {
'FunctionDeclaration': true,
Expand All @@ -19,6 +20,8 @@ module.exports = {
'no-invalid-this': OFF,
'no-multi-str': OFF,
'semi': [ERROR, 'never'],
'space-before-function-paren': OFF,
'object-curly-spacing': ['error', 'always'],
},

'parserOptions': {
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ node_modules
.vscode
*.sqlite
.nyc_output
/.idea
/src/config/tracking-uuid
*.sqlite-shm
*.sqlite-wal
*.pid
4 changes: 4 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.5
ignore: {}
patch: {}
80 changes: 0 additions & 80 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM iofog/node-alpine-x86:8.16.0

ARG FILENAME
ENV NODE_ENV=development

COPY ${FILENAME} /tmp

RUN npm i --unsafe-perm -g /tmp/${FILENAME} && \
rm -rf /tmp/${FILENAME} && \
iofog-controller config dev-mode --on && \
echo "iofog-controller start && tail -f /dev/null" >> /start.sh

CMD [ "sh", "/start.sh" ]
11 changes: 11 additions & 0 deletions Dockerfile.rel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM iofog/node-alpine-x86:8.16.0

ARG FILENAME

COPY ${FILENAME} /tmp

RUN npm i --unsafe-perm -g /tmp/${FILENAME} && \
rm -rf /tmp/${FILENAME} && \
echo "iofog-controller start && tail -f /dev/null" >> /start.sh

CMD [ "sh", "/start.sh" ]
170 changes: 170 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
trigger:
tags:
include:
- v.*
branches:
include:
- develop
- release*
paths:
exclude:
- README.md

pr:
- master
- develop

variables:
group: 'pipelines'
repository: 'focal-freedom-236620/controller'
primaryTag: $(Build.SourceBranchName)
releaseCandidate: 'rc1'

jobs:
- job: Controller
pool:
vmImage: 'Ubuntu-16.04'

steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'

- script: |
npm install
displayName: 'npm install and build'
# When we are ready to enforce standardjs, remove redirection and remove '|| true' from the standard script in package.json
- script: |
npm run standard 2>&1 | tee standardjs.out
displayName: 'Standardjs report'
- script: |
npm run snyk -- --project-name=ControllerCI
displayName: 'Snyk monitor'
env:
SNYK_TOKEN: $(snykToken)
- script: |
npm test
displayName: 'unit tests'
- script: |
echo "npm test"
displayName: 'integration tests'
- script: |
echo "##vso[task.setvariable variable=agent.jobstatus;]canceled"
echo "##vso[task.complete result=Canceled;]DONE"
condition: eq(variables['Build.Reason'], 'PullRequest')
- script: |
npm pack
ls iofogcontroller-*.tgz
displayName: 'npm pack for release artefact'
- task: CopyFiles@2
inputs:
SourceFolder: $(System.DefaultWorkingDirectory)
TargetFolder: $(Build.ArtifactStagingDirectory)
Contents: |
standardjs.out
*.tgz
Dockerfile.dev
OverWrite: true
displayName: 'artefacts to publish'

- script: |
rm -fr iofogcontroller-*.tgz
git checkout package-lock.json
git config --global user.email "info@edgeworx.io"
git config --global user.name "Azure DevOps"
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
if [[ $(Build.SourceBranch) == refs/heads/release* ]]; then
npm --no-git-tag-version version $PACKAGE_VERSION-$(releaseCandidate)-b$(Build.BuildId)
else
npm --no-git-tag-version version $PACKAGE_VERSION-b$(Build.BuildId)
fi
displayName: 'npm version'
- script: |
npm pack
displayName: 'npm pack with version containing build number'
- bash: |
echo 'checking pack file exists..'
tar=$(ls iofogcontroller-*.tgz)
echo $tar
echo "##vso[task.setvariable variable=controller_tar]$tar"
echo 'setting secondary tag'
echo "##vso[task.setvariable variable=secondaryTag]b-$(Build.BuildId)"
if [[ $(Build.SourceBranch) == refs/heads/release* ]]; then
echo "##vso[task.setvariable variable=primaryTag]rc-$(Build.SourceBranchName)"
#If branch starts with ref/tags, apply latest and version tag
elif [[ $(Build.SourceBranch) == refs/tags* ]]; then
primaryTag= echo $(primaryTag) | awk '{print substr($1,2);}'
echo $primaryTag
echo "##vso[task.setvariable variable=primaryTag]$primaryTag"
echo "##vso[task.setvariable variable=secondaryTag]latest"
fi
displayName: 'setting vars'
name: setvarStep
- task: Docker@2
displayName: 'build docker'
inputs:
containerRegistry: 'Edgeworx GCP'
repository: $(repository)
command: 'build'
Dockerfile: "Dockerfile.dev"
arguments: --build-arg FILENAME=$(controller_tar)
tags: |
$(secondaryTag)
$(primaryTag)
- task: Docker@2
displayName: 'push docker'
inputs:
containerRegistry: 'Edgeworx GCP'
repository: $(repository)
command: 'push'
Dockerfile: "Dockerfile.dev"
tags: |
$(secondaryTag)
$(primaryTag)
- script: |
echo "npm test"
displayName: 'api tests'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'controller'

- task: DownloadSecureFile@1
inputs:
secureFile: 'package_cloud'
displayName: 'download package cloud token file'

- task: UseRubyVersion@0
inputs:
versionSpec: '>= 2.5'
addToPath: true
displayName: 'install rubygem to be used to install package_cloud cli'

- script: |
gem install package_cloud
package_cloud -h
echo "config file..."
echo $DOWNLOADSECUREFILE_SECUREFILEPATH
displayName: 'install package_cloud cli'
- script: |
echo $(controller_tar)
package_cloud push iofog/iofog-controller-snapshots/node/1 $(controller_tar) --config=$DOWNLOADSECUREFILE_SECUREFILEPATH
displayName: 'push to package cloud'
Loading

0 comments on commit 2fae0cb

Please sign in to comment.