Remove useless scripts (#8704)
Konstantinos Natsakis committed
Apr 15, 2020 at 10:43 UTC
bd0bae3d1a90be9422cf04110300f1715dfec8cc
3 files changed
-237
packaging/docker/README.md
-36
@@ -247,42 +247,6 @@ Caddyfile.
247
At Netdata, we provide multiple ways of testing your Docker images using your own repositories.
248
You may either use the command line tools available or take advantage of our Travis CI infrastructure.
249
250
-### Using tools manually from the command line
251
-
252
-The script `packaging/docker/build-test.sh` can be used to create an image and upload it to a repository of your
253
-choosing.
254
-
255
-```bash
256
-Usage: packaging/docker/build-test.sh -r <REPOSITORY> -v <VERSION> -u <DOCKER_USERNAME> -p <DOCKER_PWD> [-s]
257
- -s skip build, just push the image
258
-Builds an amd64 image and pushes it to the docker hub repository REPOSITORY
259
-```
260
-
261
-This is especially useful when testing a Pull Request for Kubernetes, since you can set `image` to an immutable
262
-repository and tag, set the `imagePullPolicy` to `Always` and just keep uploading new images.
263
-
264
-Example:
265
-
266
-We get a local copy of the Helm chart at <https://github.com/netdata/helmchart>. We modify `values.yaml` to have the
267
-following:
268
-
269
-```yaml
270
-image:
271
- repository: cakrit/netdata-prs
272
- tag: PR5576
273
- pullPolicy: Always
274
-```
275
-
276
-We check out PR5576 and run the following:
277
-
278
-```bash
279
-./packaging/docker/build-test.sh -r cakrit/netdata-prs -v PR5576 -u cakrit -p 'XXX'
280
-```
281
-
282
-Then we can run `helm install [path to our helmchart clone]`.
283
-
284
-If we make changes to the code, we execute the same `build-test.sh` command, followed by `helm upgrade [name] [path to our helmchart clone]`
285
-
250
### Inside Netdata organization, using Travis CI
251
252
To enable Travis CI integration on your own repositories (Docker and Github), you need to be part of the Netdata
packaging/docker/build-test.sh
deleted
-74
@@ -1,74 +0,0 @@
1
-#!/bin/bash
2
-# Docker build wrapper, for testing manually the docker build process
3
-# TODO: This script should consume build.sh after setting up required parameters
4
-#
5
-# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
6
-#
7
-# Author : Chris Akritidis (chris@netdata.cloud)
8
-# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud)
9
-
10
-printhelp() {
11
- echo "Usage: packaging/docker/build-test.sh -r <REPOSITORY> -v <VERSION> -u <DOCKER_USERNAME> -p <DOCKER_PWD> [-s]
12
- -s skip build, just push the image
13
-Builds an amd64 image and pushes it to the docker hub repository REPOSITORY"
14
-}
15
-
16
-set -e
17
-
18
-if [ ! -f .gitignore ]; then
19
- echo "Run as ./packaging/docker/$(basename "$0") from top level directory of git repository"
20
- exit 1
21
-fi
22
-
23
-DOBUILD=1
24
-while getopts :r:v:u:p:s option
25
-do
26
- case "$option" in
27
- r)
28
- REPOSITORY=$OPTARG
29
- ;;
30
- v)
31
- VERSION=$OPTARG
32
- ;;
33
- u)
34
- DOCKER_USERNAME=$OPTARG
35
- ;;
36
- p)
37
- DOCKER_PWD=$OPTARG
38
- ;;
39
- s)
40
- DOBUILD=0
41
- ;;
42
- *)
43
- printhelp
44
- exit 1
45
- ;;
46
- esac
47
-done
48
-
49
-if [ -n "${REPOSITORY}" ]; then
50
- if [ $DOBUILD -eq 1 ] ; then
51
- echo "Building ${VERSION:-latest} of ${REPOSITORY} container"
52
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
53
-
54
- # Build images using multi-arch Dockerfile.
55
- eval docker build --build-arg ARCH="amd64" --tag "${REPOSITORY}:${VERSION:-latest}" --file packaging/docker/Dockerfile ./
56
-
57
- # Create temporary docker CLI config with experimental features enabled (manifests v2 need it)
58
- mkdir -p /tmp/docker
59
- #echo '{"experimental":"enabled"}' > /tmp/docker/config.json
60
- fi
61
-
62
- if [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PWD}" ] ; then
63
- # Login to docker hub to allow futher operations
64
- echo "Logging into docker"
65
- echo "$DOCKER_PWD" | docker --config /tmp/docker login -u "$DOCKER_USERNAME" --password-stdin
66
-
67
- echo "Pushing ${REPOSITORY}:${VERSION}"
68
- docker --config /tmp/docker push "${REPOSITORY}:${VERSION}"
69
- fi
70
-else
71
- echo "Missing parameter. REPOSITORY=${REPOSITORY}"
72
- printhelp
73
- exit 1
74
-fi
packaging/manual_nightly_deployment.sh
deleted
-127
@@ -1,127 +0,0 @@
1
-#!/usr/bin/env bash
2
-#
3
-# This tool allows netdata team to manually deploy nightlies
4
-# It emulates the nightly operations required for a new version to be published for our users
5
-#
6
-# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
7
-#
8
-# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
9
-#
10
-set -e
11
-
12
-# If we are not in netdata git repo, at the top level directory, fail
13
-TOP_LEVEL=$(basename "$(git rev-parse --show-toplevel)")
14
-CWD=$(git rev-parse --show-cdup || echo "")
15
-if [ -n "${CWD}" ] || [ ! "${TOP_LEVEL}" == "netdata" ]; then
16
- echo "Run as .travis/$(basename "$0") from top level directory of netdata git repository"
17
- echo "Changelog generation process aborted"
18
- exit 1
19
-fi
20
-
21
-if [ $# -lt 1 ] || [ $# -gt 2 ]; then
22
- echo "Run as ./$(basename "$0") [docker|gcs]|all] from the top level directory of netdata GIT repository"
23
- exit 1
24
-fi
25
-
26
-GSUTIL_BINARY=$(command -v gsutil 2> /dev/null)
27
-if [ -z "${GSUTIL_BINARY}" ]; then
28
- echo "No gsutil utility available, you need gsutil deployed to manually deploy to GCS"
29
- exit 1
30
-fi;
31
-
32
-# Function declarations
33
-publish_docker() {
34
-
35
- # Ensure REPOSITORY present
36
- if [ -z "${REPOSITORY}" ]; then
37
- echo "Please provide the repository to deploy the containers:"
38
- read -r REPOSITORY
39
- export REPOSITORY
40
- else
41
- echo "Docker publishing to ${REPOSITORY}"
42
- fi
43
-
44
- # Ensure DOCKER_USERNAME present
45
- if [ -z "${DOCKER_USERNAME}" ]; then
46
- echo "For repository ${REPOSITORY}, Please provide the docker USERNAME to use:"
47
- read -r DOCKER_USERNAME
48
- export DOCKER_USERNAME
49
- else
50
- echo "Using docker username ${DOCKER_USERNAME}"
51
- fi
52
-
53
- # Ensure DOCKER_PASS present
54
- if [ -z "${DOCKER_PASS}" ]; then
55
- echo "Username ${DOCKER_USERNAME} received, now give me the password:"
56
- read -r -s DOCKER_PASS
57
- export DOCKER_PASS
58
- else
59
- echo "Docker password has already been set to env, using that"
60
- fi
61
-
62
- echo "Building Docker images.."
63
- RELEASE_CHANNEL=nightly packaging/docker/build.sh
64
-
65
- echo "Publishing Docker images.."
66
- packaging/docker/publish.sh
67
-}
68
-
69
-publish_nightly_binaries() {
70
- echo "Publishing nightly binaries to GCS"
71
-
72
- echo "Please select the bucket to sync, from the ones available to you:"
73
- bucket_list=$(${GSUTIL_BINARY} list | tr '\n' ' ')
74
- declare -A buckets
75
- idx=0
76
- for abucket in ${bucket_list}; do
77
- echo "${idx}. ${abucket}"
78
- buckets["${idx}"]=${abucket}
79
- ((idx=idx+1))
80
- done
81
- read -p"Selection>" -r -n 1 selected_bucket
82
-
83
- echo "Ok!"
84
- echo "Syncing artifacts directory contents with GCS bucket: ${buckets[${selected_bucket}]}"
85
- if [ -d artifacts ]; then
86
- ${GSUTIL_BINARY} -m rsync -r artifacts "${buckets["${selected_bucket}"]}"
87
- echo "GCS Sync complete!"
88
- else
89
- echo "Directory artifacts does not exist, nothing to do on GCS"
90
- fi
91
-}
92
-
93
-prepare_and_publish_gcs() {
94
- # Prepare the artifacts directory
95
- echo "Preparing artifacts directory contents"
96
- .travis/create_artifacts.sh
97
-
98
- # Publish it to GCS
99
- publish_nightly_binaries
100
-
101
- # Clean up
102
- echo "Cleaning up repository"
103
- make clean || echo "Nothing to clean"
104
- make distclean || echo "Nothing to distclean"
105
- rm -rf artifacts
106
-}
107
-
108
-# Mandatory variable declarations
109
-export TRAVIS_REPO_SLUG="netdata/netdata"
110
-
111
-echo "Manual nightly deployment procedure started"
112
-case "$1" in
113
- "docker")
114
- publish_docker
115
- ;;
116
- "gcs")
117
- prepare_and_publish_gcs
118
- ;;
119
- "all")
120
- publish_docker
121
- prepare_and_publish_gcs
122
- ;;
123
- *)
124
- echo "ERROR: Invalid request parameter $1. Valid values are: docker, gcs, all"
125
- ;;
126
-esac
127
-echo "Manual nightly deployment completed!"