summaryrefslogtreecommitdiffstats
path: root/jjb/include-docker-login.sh
blob: 3b677b46dff50aa2884d11a207beadc859618d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
                   nexus3.openecomp.org:10002 \
                   nexus3.openecomp.org:10003"

for DOCKER_REPOSITORY in $DOCKER_REPOSITORIES;
do
    echo $DOCKER_REPOSITORY
    USER=$(xpath -e "//servers/server[id='$DOCKER_REPOSITORY']/username/text()" "$SETTINGS_FILE")
    PASS=$(xpath -e "//servers/server[id='$DOCKER_REPOSITORY']/password/text()" "$SETTINGS_FILE")

    if [ -z "$USER" ];
    then
        echo "Error: no user provided"
    fi

    if [ -z "$PASS" ];
    then
        echo "Error: no password provided"
    fi

    [ -z "$PASS" ] && PASS_PROVIDED="<empty>" || PASS_PROVIDED="<password>"
    echo docker login $DOCKER_REPOSITORY -u "$USER" -p "$PASS_PROVIDED"
    docker login $DOCKER_REPOSITORY -u "$USER" -p "$PASS"
done
> { Response } from '@angular/http'; import { Observable } from 'rxjs'; import { ISdcConfig, SdcConfigToken } from '../config/sdc-config.config'; // tslint:disable-next-line:interface-name export interface IServerResponse { data: [{ [key: string]: string }]; } export class GabRequest { constructor(public fields: string[], public parentId: string, public artifactUniqueId: string) { } } // tslint:disable-next-line:max-classes-per-file @Injectable() export class GabService { baseUrl: string; gabUrl: string; constructor(@Inject(SdcConfigToken) sdcConfig: ISdcConfig, protected http: HttpClient) { this.baseUrl = sdcConfig.api.root; this.gabUrl = sdcConfig.api.POST_GAB_Search; } public getArtifact(artifactUniqueId: string, resourceId: string, columns: string[]): Observable<Response> { const finalUrl: string = this.baseUrl + this.gabUrl; const request: GabRequest = { fields: columns, parentId: resourceId, artifactUniqueId }; return this.http.post<Response>(finalUrl, request); } }