Browse Source

Remove unused files

Artem Smirnov 7 months ago
parent
commit
dcabd1ccc0
6 changed files with 0 additions and 160 deletions
  1. 0
    1
      .gitignore
  2. 0
    23
      build.sh
  3. 0
    51
      push.sh
  4. 0
    33
      run.sh
  5. 0
    14
      shell.sh
  6. 0
    38
      vars

+ 0
- 1
.gitignore View File

@@ -1 +0,0 @@
1
-builds

+ 0
- 23
build.sh View File

@@ -1,23 +0,0 @@
1
-#!/bin/bash
2
-
3
-source vars
4
-
5
-DOCKERFILE="${1:-Dockerfile}"
6
-
7
-docker build -t "${REPO_NAME}/${APP_NAME}:${TAG}" -f ${DOCKERFILE} .
8
-
9
-# If the build was successful (0 exit code)...
10
-if [ $? -eq 0 ]; then
11
-  echo
12
-  echo "Build of ${REPO_NAME}/${APP_NAME}:${TAG} completed OK"
13
-  echo
14
-
15
-  # log build details to builds file
16
-  echo "`date` => ${REPO_NAME}/${APP_NAME}:${TAG}" >> builds
17
-
18
-# The build exited with an error.
19
-else
20
-  echo "Build failed!"
21
-  exit 1
22
-
23
-fi

+ 0
- 51
push.sh View File

@@ -1,51 +0,0 @@
1
-#!/bin/bash
2
-
3
-source vars
4
-
5
-#This will take the latest locally built image and push it to the repository as
6
-#configured in vars and tag it as latest.
7
-
8
-if [[ ! -f builds ]]; then
9
-  echo
10
-  echo "It appears that the Docker image hasn't been built yet, run build.sh first"
11
-  echo
12
-  exit 1
13
-fi
14
-
15
-LATESTIMAGE=`tail -1 builds | awk '{print $8}'`
16
-
17
-# Flatten is here as an option and not the default because with the export/import
18
-# process we lose Dockerfile attributes like PORT and VOLUMES. Flattening helps if
19
-# we are concerned about hitting the AUFS 42 layer limit or creating an image that
20
-# other containers source FROM
21
-
22
-DockerExport () {
23
-  docker export ${APP_NAME} | docker import - ${REPO_NAME}/${APP_NAME}:latest
24
-}
25
-
26
-DockerPush () {
27
-  docker push ${REPO_NAME}/${APP_NAME}:latest
28
-}
29
-
30
-case "$1" in
31
-  flatten)
32
-    docker inspect ${APP_NAME} > /dev/null 2>&1
33
-    if [[ $? -ne 0 ]]; then
34
-      echo "The ${APP_NAME} container doesn't appear to exist, exiting"
35
-      exit 1
36
-    fi
37
-    RUNNING=`docker inspect ${APP_NAME} | python -c 'import sys, json; print json.load(sys.stdin)[0]["State"]["Running"]'`
38
-    if [[ "${RUNNING}" = "True" ]]; then
39
-      echo "Stopping ${APP_NAME} container for export"
40
-      docker stop ${APP_NAME}
41
-      DockerExport
42
-      DockerPush
43
-    else
44
-      DockerExport
45
-      DockerPush
46
-    fi
47
-    ;;
48
-  *)
49
-    docker tag -f ${LATESTIMAGE} ${REPO_NAME}/${APP_NAME}:latest
50
-    DockerPush
51
-esac

+ 0
- 33
run.sh View File

@@ -1,33 +0,0 @@
1
-#!/bin/bash
2
-
3
-source vars
4
-
5
-#If there is a locally built image present, prefer that over the
6
-#one in the registry, we're going to assume you're working on changes
7
-#to the image.
8
-
9
-if [[ ! -f builds ]]; then
10
-  LATESTIMAGE=${REPO_NAME}/${APP_NAME}:latest
11
-else
12
-  LATESTIMAGE=`tail -1 builds | awk '{print $8}'`
13
-fi
14
-echo
15
-echo "Starting $APP_NAME..."
16
-echo
17
-echo -n "Container ID: "
18
-docker run \
19
---detach=true \
20
---log-driver=syslog \
21
---name="${APP_NAME}" \
22
---restart=always \
23
--e FULL_NAME="${FULL_NAME}" \
24
--e EMAIL_ADDRESS="${EMAIL_ADDRESS}" \
25
--e GPG_PASSWORD="${GPG_PASSWORD}" \
26
--e HOSTNAME="${HOSTNAME}" \
27
--v ${APTLY_DATADIR}:/opt/aptly \
28
--p ${DOCKER_HOST_PORT}:80 \
29
-${LATESTIMAGE}
30
-# Other useful options
31
-# -p DOCKERHOST_PORT:CONTAINER_PORT \
32
-# -e "ENVIRONMENT_VARIABLE_NAME=VALUE" \
33
-# -v /DOCKERHOST/PATH:/CONTAINER/PATH \

+ 0
- 14
shell.sh View File

@@ -1,14 +0,0 @@
1
-#!/bin/bash
2
-
3
-source vars
4
-
5
-PYTHON=`which python || which python3`
6
-
7
-docker inspect ${APP_NAME} > /dev/null 2>&1
8
-if [[ $? -ne 0 ]]; then
9
-  echo "The ${APP_NAME} container doesn't appear to exist, exiting"
10
-fi
11
-
12
-CONTAINER_ID=`docker inspect ${APP_NAME} | $PYTHON -c 'import sys, json; print(json.load(sys.stdin)[0]["Id"])'`
13
-
14
-docker exec -it ${CONTAINER_ID} /bin/bash

+ 0
- 38
vars View File

@@ -1,38 +0,0 @@
1
-#!/bin/bash
2
-
3
-#### BEGIN APP SPECIFIC VARIABLES
4
-
5
-# Name of the container
6
-APP_NAME=aptly
7
-# Docker Hub Username or internal registry (e.g. docker-registry.example.com:5000)
8
-REPO_NAME="myusername"
9
-
10
-# Name used on repository signing key
11
-FULL_NAME="First Last"
12
-# Email address of the repository key signer
13
-EMAIL_ADDRESS=user@example.com
14
-# Password used to encrypt the signing key
15
-GPG_PASSWORD=repo1234
16
-# The directory on the Docker host to store repository data
17
-APTLY_DATADIR=/tmp/path/to/lots/of/space
18
-# FQDN of the Docker host that the aptly container will run on 
19
-HOSTNAME=aptly.example.com
20
-# TCP port that aptly will be reachable on, set to something else if you already
21
-# have a web server running on your Docker host
22
-DOCKER_HOST_PORT=80
23
-
24
-#### END APP SPECIFIC VARIABLES
25
-#### BEGIN GENERIC VARIABLES
26
-  
27
-# Get an SHA sum of all files involved in building the image so the image can be tagged
28
-# this will provide assurance that any image with the same tag was built the same way. 
29
-SHASUM=`find . -type f \
30
-        -not -path "*/.git/*" \
31
-        -not -path "*.gitignore*" \
32
-        -not -path "*builds*" \
33
-        -not -path "*run.sh*" \
34
-        -exec shasum {} + | awk '{print $1}' | sort | shasum | cut -c1-4`
35
-  
36
-TAG="`date +%Y%m%d`-${SHASUM}"
37
-
38
-#### END GENERIC VARIABLES

Loading…
Cancel
Save