Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Update github asset integration test and readme (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob0h committed Dec 12, 2018
1 parent 4ed00c7 commit 619eb77
Show file tree
Hide file tree
Showing 25 changed files with 920 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -51,12 +51,12 @@ There are two ways you can get started with Ship:
Ship is packaged as a single binary, and Linux and MacOS versions are distributed:
- To download the latest Linux build, run:
```shell
curl -sSL https://github.com/replicatedhq/ship/releases/download/v0.26.0/ship_0.26.0_linux_amd64.tar.gz | tar xv && sudo mv ship /usr/local/bin
curl -sSL https://github.com/replicatedhq/ship/releases/download/v0.28.0/ship_0.28.0_linux_amd64.tar.gz | tar xv && sudo mv ship /usr/local/bin
```

- To download the latest MacOS build, run:
```shell
curl -sSL https://github.com/replicatedhq/ship/releases/download/v0.26.0/ship_0.26.0_darwin_amd64.tar.gz | tar xv && sudo mv ship /usr/local/bin
curl -sSL https://github.com/replicatedhq/ship/releases/download/v0.28.0/ship_0.28.0_darwin_amd64.tar.gz | tar xv && sudo mv ship /usr/local/bin
```

Ship is also available through [Homebrew](https://brew.sh/):
Expand Down
21 changes: 20 additions & 1 deletion integration/init_app/helm-github/expected/.ship/release.yml
Expand Up @@ -2,12 +2,31 @@
assets:
v1:
- helm:
dest: charts/rendered
dest: charts/values-static-public-source
github:
repo: replicatedhq/test-charts
ref: ff4868c3329dca771f773b36afe0451b773eff3f
path: values-static
source: public
- helm:
dest: charts/minio-forked-proxy
github:
repo: replicatedhq/test-charts
ref: 04c90a93df7765f5cd896ca2f95a2801146543b0
path: minio-forked
proxy: true
- github:
dest: plain-k8s-no-proxy
repo: replicatedhq/test-charts
ref: 3427d6997bd150c60caa00ba0298fdfe17e3ed04
path: plain-k8s
proxy: false
- github:
dest: postgres-forked-private-source
repo: replicatedhq/test-charts
ref: eb834c80b4a381d7c99798935ee386107619b2a1
path: postgres-forked
source: private
config: {}
lifecycle:
v1:
Expand Down
10 changes: 5 additions & 5 deletions integration/init_app/helm-github/expected/.ship/state.json
@@ -1,15 +1,15 @@
{
"v1": {
"config": {},
"releaseName": "integration-replicated-app-helm-github",
"upstream": "__upstream__",
"contentSHA": "3f27933df35c90e60a3c943e6fa765bc6116e8e6e17f89cdb6976ccc52e1cb65",
"metadata": {
"applicationType": "replicated.app",
"releaseNotes": "",
"version": "1.0.1-SNAPSHOT",
"customerID": "__customerID__",
"installationID": "__installationID__",
"releaseNotes": "integration tests",
"version": "1.0.0-SNAPSHOT"
"installationID": "__installationID__"
},
"releaseName": "integration-replicated-app-helm-github"
"contentSHA": "275a18f485ae78a3e0c723da1625fa08d12bb27dc401c49f15231a31d939676e"
}
}
@@ -0,0 +1,215 @@
---
# Source: minio/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: integration-replicated-app-helm-github
labels:
app: minio
chart: minio-2.2.0
release: integration-replicated-app-helm-github
heritage: Tiller
data:
initialize: |-
#!/bin/sh
set -e ; # Have script exit in the event of a failed command.
# connectToMinio
# Use a check-sleep-check loop to wait for Minio service to be available
connectToMinio() {
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
set -e ; # fail if we can't read the keys.
ACCESS=$(cat /config/accesskey) ; SECRET=$(cat /config/secretkey) ;
set +e ; # The connections to minio are allowed to fail.
echo "Connecting to Minio server: http://$MINIO_ENDPOINT:$MINIO_PORT" ;
MC_COMMAND="mc config host add myminio http://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
$MC_COMMAND ;
STATUS=$? ;
until [ $STATUS = 0 ]
do
ATTEMPTS=`expr $ATTEMPTS + 1` ;
echo \"Failed attempts: $ATTEMPTS\" ;
if [ $ATTEMPTS -gt $LIMIT ]; then
exit 1 ;
fi ;
sleep 2 ; # 1 second intervals between attempts
$MC_COMMAND ;
STATUS=$? ;
done ;
set -e ; # reset `e` as active
return 0
}
# checkBucketExists ($bucket)
# Check if the bucket exists, by using the exit code of `mc ls`
checkBucketExists() {
BUCKET=$1
CMD=$(/usr/bin/mc ls myminio/$BUCKET > /dev/null 2>&1)
return $?
}
# createBucket ($bucket, $policy, $purge)
# Ensure bucket exists, purging if asked to
createBucket() {
BUCKET=$1
POLICY=$2
PURGE=$3
# Purge the bucket, if set & exists
# Since PURGE is user input, check explicitly for `true`
if [ $PURGE = true ]; then
if checkBucketExists $BUCKET ; then
echo "Purging bucket '$BUCKET'."
set +e ; # don't exit if this fails
/usr/bin/mc rm -r --force myminio/$BUCKET
set -e ; # reset `e` as active
else
echo "Bucket '$BUCKET' does not exist, skipping purge."
fi
fi
# Create the bucket if it does not exist
if ! checkBucketExists $BUCKET ; then
echo "Creating bucket '$BUCKET'"
/usr/bin/mc mb myminio/$BUCKET
else
echo "Bucket '$BUCKET' already exists."
fi
# At this point, the bucket should exist, skip checking for existence
# Set policy on the bucket
echo "Setting policy of bucket '$BUCKET' to '$POLICY'."
/usr/bin/mc policy $POLICY myminio/$BUCKET
}
# Try connecting to Minio instance
connectToMinio
# Create the bucket
createBucket bucket none false
config.json: |-
{
"version": "26",
"credential": {
"accessKey": "AKIAIOSFODNN7EXAMPLE",
"secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
},
"region": "us-east-1",
"worm": "off",
"storageclass": {
"standard": "",
"rrs": ""
},
"cache": {
"drives": [],
"expiry": 90,
"maxuse": 80,
"exclude": []
},
"notify": {
"amqp": {
"1": {
"enable": false,
"url": "",
"exchange": "",
"routingKey": "",
"exchangeType": "",
"deliveryMode": 0,
"mandatory": false,
"immediate": false,
"durable": false,
"internal": false,
"noWait": false,
"autoDeleted": false
}
},
"nats": {
"1": {
"enable": false,
"address": "",
"subject": "",
"username": "",
"password": "",
"token": "",
"secure": false,
"pingInterval": 0,
"streaming": {
"enable": false,
"clusterID": "",
"clientID": "",
"async": false,
"maxPubAcksInflight": 0
}
}
},
"elasticsearch": {
"1": {
"enable": false,
"format": "namespace",
"url": "",
"index": ""
}
},
"redis": {
"1": {
"enable": false,
"format": "namespace",
"address": "",
"password": "",
"key": ""
}
},
"postgresql": {
"1": {
"enable": false,
"format": "namespace",
"connectionString": "",
"table": "",
"host": "",
"port": "",
"user": "",
"password": "",
"database": ""
}
},
"kafka": {
"1": {
"enable": false,
"brokers": null,
"topic": ""
}
},
"webhook": {
"1": {
"enable": false,
"endpoint": ""
}
},
"mysql": {
"1": {
"enable": false,
"format": "namespace",
"dsnString": "",
"table": "",
"host": "",
"port": "",
"user": "",
"password": "",
"database": ""
}
},
"mqtt": {
"1": {
"enable": false,
"broker": "",
"topic": "",
"qos": 0,
"clientId": "",
"username": "",
"password": "",
"reconnectInterval": 0,
"keepAliveInterval": 0
}
}
}
}
@@ -0,0 +1,95 @@
---
# Source: minio/templates/deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: integration-replicated-app-helm-github
labels:
app: minio
chart: minio-2.2.0
release: integration-replicated-app-helm-github
heritage: Tiller
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
selector:
matchLabels:
app: minio
release: integration-replicated-app-helm-github
template:
metadata:
name: integration-replicated-app-helm-github
labels:
app: minio
release: integration-replicated-app-helm-github
spec:
containers:
- name: minio
image: "minio/minio:RELEASE.2018-12-06T01-27-43Z"
imagePullPolicy: IfNotPresent
command: [ "/bin/sh",
"-ce",
"cp /tmp/config.json /root/.minio/ &&
/usr/bin/docker-entrypoint.sh minio -C /root/.minio/ server /export" ]
volumeMounts:
- name: export
mountPath: /export
- name: minio-server-config
mountPath: "/tmp/config.json"
subPath: config.json
- name: minio-config-dir
mountPath: /root/.minio/
ports:
- name: service
containerPort: 9000
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: integration-replicated-app-helm-github
key: accesskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: integration-replicated-app-helm-github
key: secretkey
- name: MINIO_BROWSER
value: "on"
livenessProbe:
httpGet:
path: /minio/health/live
port: service
initialDelaySeconds: 5
periodSeconds: 30
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /minio/health/ready
port: service
periodSeconds: 15
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
resources:
requests:
cpu: 250m
memory: 256Mi

volumes:
- name: export
persistentVolumeClaim:
claimName: integration-replicated-app-helm-github
- name: minio-server-config
configMap:
name: integration-replicated-app-helm-github
- name: minio-user
secret:
secretName: integration-replicated-app-helm-github
- name: minio-config-dir
emptyDir: {}

0 comments on commit 619eb77

Please sign in to comment.