This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [[ $(kubectl get pods kaniko-$(tag) -n kaniko -o jsonpath='{..status.phase}') != "Running" && $(kubectl get pods kaniko-$(tag) -n kaniko -o jsonpath='{..status.phase}') != "Failed" ]]; | |
do | |
if [ $(kubectl get pods kaniko-$(tag) -n kaniko -o jsonpath='{..status.phase}') == "Failed" ]; then | |
kubectl logs -n kaniko kaniko-$(tag) | |
kubectl delete pod -n kaniko kaniko-$(tag) | |
exit 1 | |
fi | |
echo "waiting for pod to initialise" && sleep 1; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > deploy.yaml <<EOF | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: kaniko-$(tag) | |
namespace: kaniko | |
spec: | |
restartPolicy: Never | |
containers: | |
- args: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# package the source code | |
cd $(buildDirectory) | |
tar -czvf /azp/agent/_work/$(tag).tar.gz . | |
#Upload the tar file to Azure Storage | |
az storage blob upload --account-name <storage> --container-name kaniko --file /azp/agent/_work/$(tag).tar.taz --name $(tag).tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a namespace for kaniko | |
resource "kubernetes_namespace" "kaniko" { | |
metadata { | |
labels { | |
namespace = "kaniko" | |
} | |
name = "kaniko" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use SilverStripe\ORM\DataObject; | |
use SilverStripe\Forms\FieldList; | |
use SilverStripe\Forms\TextField; | |
use SilverStripe\Forms\TextareaField; | |
use SilverStripe\Versioned\Versioned; | |
use SilverStripe\Control\Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UserArr = $this->User->find('all',array( | |
'fields'=>array( | |
'id', | |
'surname', | |
'age', | |
'date_of_birth', | |
'sex', | |
'CAST(CASE WHEN bp3_value1="" THEN bp2_date | |
WHEN bp2_code="" THEN bp1_date | |
WHEN bp1_code="" THEN 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function create() { | |
$this->checkPermissions(); | |
$this->request->allowMethod('post'); | |
// @todo decrypt data from mcrypt string | |
$data = json_decode($this->request->data['User'],true); | |
$data['created']=date('Y-m-d H:i:s'); | |
$data['modified']=date('Y-m-d H:i:s'); | |
$data['mark_for_deletion']=0; | |
unset($data['id']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = array( | |
'created'=>'2014-10-21 09:00:00', | |
'modified'=>'2014-10-21 09:00:00', | |
'mark_for_deletion'=>0, | |
'user_details'=>array( | |
'name'=>'John', | |
'created'=>'2014-10-21 09:00:00 | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In User Model | |
$this->hasMany('UserDetails'); | |
// In User Controller | |
$data['created']=date('Y-m-d H:i:s'); | |
$data['modified']=date('Y-m-d H:i:s'); | |
$data['mark_for_deletion']=0; | |
$data['user_details']['name']='john'; | |
$data['user_details']['created']=date('Y-m-d H:i:s'); | |