jq is useful to slice, filter, map and transform structured json data.
brew install jq
| # export the task def | |
| family='TaskDefName' | |
| $ aws ecs describe-task-definition --task-definition $family \ | |
| --query "taskDefinition.{family:family, taskRoleArn:taskRoleArn, executionRoleArn:executionRoleArn, networkMode:networkMode, containerDefinitions:containerDefinitions, volumes:volumes, placementConstraints:placementConstraints, requiresCompatibilities:requiresCompatibilities, cpu:cpu, memory:memory, tags:tags, pidMode:pidMode, ipcMode:ipcMode, proxyConfiguration:proxyConfiguration}" | jq 'del(.[] | nulls)' > taskDef.json | |
| # import the task def into newFamily task family | |
| $ aws ecs register-task-definition --cli-input-json file://taskDef.json --family newFamily | |
| # one-liner | |
| aws ecs describe-task-definition --task-definition $family \ |
| #!/bin/bash | |
| #Jenkins provides: | |
| #GIT_COMMIT like ce9a3c1404e8c91be604088670e93434c4253f03 | |
| #GIT_BRANCH like origin/master | |
| #BUILD_URL like http://jenkins.test.cirrostratus.org/job/Article_View_c20n_Full_Non_Destructive_Full_Suite/1334/ | |
| # per https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin | |
| # The jenkins pull request builder plugin (if configured) will provide these: | |
| #ghprbPullId |
| pipeline { | |
| // run on jenkins nodes tha has java 8 label | |
| agent { label 'java8' } | |
| // global env variables | |
| environment { | |
| EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com' | |
| } | |
| stages { | |
| stage('Build with unit testing') { |
| Some Jenkinsfile examples |
| ;;;;;;;;;;;;;;;;;;;;; | |
| ; FPM Configuration ; | |
| ;;;;;;;;;;;;;;;;;;;;; | |
| ; All relative paths in this configuration file are relative to PHP's install | |
| ; prefix. | |
| ; Include one or more files. If glob(3) exists, it is used to include a bunch of | |
| ; files from a glob(3) pattern. This directive can be used everywhere in the | |
| ; file. |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
| #!/usr/bin/env groovy | |
| /** | |
| * notify slack and set message based on build status | |
| */ | |
| import net.sf.json.JSONArray; | |
| import net.sf.json.JSONObject; | |
| import hudson.tasks.test.AbstractTestResultAction; | |
| import hudson.model.Actionable; |
Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator
This document is an attempt to describe the first step of a large project structure with flask and some basic modules:
Please feel free to fix and add your own tips.